Change hostname / Computer name
Temporary:-
hostname [NewComputerNameHere]
The command above will last until restart.
Permanently:-
sudo gedit /etc/hostname /etc/hosts
The command above will let you edit two files, /etc/hostname and /etc/hosts
1. For the /etc/hostname file can be easily done.
Just rename the existing name to the new computer name you want.
Then make sure you save your file.
Just rename the existing name to the new computer name you want.
Then make sure you save your file.
2. For the /etc/hosts file, you have to look for the following line in the file.
127.0.1.1 YOUR-HOSTNAME
Replace your new computer name with the old name.
Then make sure you save your file.
Finally, reboot your system to let it take effect.
Then make sure you save your file.
Finally, reboot your system to let it take effect.
Check your network IP address
hostname -I
The command above will show all addresses for the host.
ifconfig
The command above will show quite an amount of information. For this section, we are interested in the network IP address, therefore, we will lookout for the keyword "inet addr". Beside this will be the IP address for this network interface.
You might had notice that there are multiple inet addr on your terminal.
One under wlan0, one under eth0 or one under lo.
1. wlan0 will normally be the first wireless network card that your system have.
2. eth0 will normally be the first wired network port that your system have.
3. lo is a loopback interface on your system that is normally use for testing and troubleshooting for
software developers.
Check which account you are currently using
whoami
The command above will show which user are you currently. This command is useful when you switch users frequently using the su command and you had lost track of which account are you in currently.