All Distros, System/Adapters

dmidecode: Getting the serial number of your x86 system

The serial number of your system can be easily found on the bottom of your laptop in most of the systems. However, if you are working with a remote server and need to collect its info things get a little complicated. But fear not, for there is dmidecode to save your day.

From the man page:

dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table
 contents in a human-readable format. This table contains a description of
 the system's hardware components, as well as other useful pieces of informa‐
 tion such as serial numbers and BIOS revision.(...)

So, give it a try and see what a plethora of information types you can see using a single command.

As for the serial number, issue:

$ sudo dmidecode -s system-serial-number

In my system:

$ sudo dmidecode -s system-serial-number
[sudo] password for dbkreling: 
BR5D81F0N

Cheers!

Advertisements
All Distros, System/Adapters

Create a new user on your system

This is a quick checklist on how to create a user from the command line:
1. useradd -m your_username (add a user called your_username with a home directory)
2. passwd your_username (set a password for your_username)
3. usermod -aG wheel your_username  (to include the user in the sudoers list)
4. su - your_username (to change to the your_username account)
NOTE: sudo usermod -a -G sudo username (to include user ‘username’ in the sudo group)