Basic Linux commands


This series is for people who love to enter the world of Linux. With the introduction of microservices, a lot of people started to show interest to learn Linux.


Here we are not covering any advanced topics of Linux. It is for the people who are stepping into the world of Linux. Especially for those who wanted to learn Linux as a stepping stone for Kubernetes.


Most of the system administrators work remotely by accessing the system through ssh or telnet. If you are using a windows desktop to connect the remote system most common method is through putty.


We will see what information we may require once get into the a Linux system.


  • "tty" Reveals the current terminal.

  • "whoami" Reveals the currently logged-in user

  • "who am i" Almost the same as the above command. This command shows the session information. We are discussing more on this later in this module.

  • "su" Switch user. Change the effective user id and group id to that user you given after the "su" command.

Note:- the usage of “-” switches the user along with its environment variables.

  • "who" The command "who" is similar to "who am i". But list the information about all the user sessions in the system.

  • "w" Command shows session information along with the overall server "Load average" and a few other details.

  • last Command shows the historical data of logged in user sessions etc. This command fetches data from "/var/log/wtmp". Don't try to view or edit this file. It stores the data in binary format.

  • "which" Reveals wherein the search path the program is located. In simple words, it shows the full path of the command we gave.

  • "uname" It gives information about the system and kernel.

            • uname -n → Displays the node name/hostname.

            • uname -r → It tells about the current running kernel.

            • uname -a → gives lots of information which we are discussing later.

  • echo Prints the string to the standard output.

    • Example: echo “Hello, welcome to the world of Linux."


Some of the above commands need a bit detailed explanation to understand their proper usage. We will discuss it with the help of some examples.