Learn linux

Linux Essential Commands for Getting Started

Linux Essential Commands for Getting Started

My Setup:

Though I’m using RHEL8 for this post, almost everything applies to other Linux distributions as well.

Seven Basic Commands:

  • whoami - shows the name of the current user
  • hostname - shows the name of the host
  • uname -a - information about the kernel, build, and platform
  • passwd - manage password
  • touch - create a new file and change the timestamp
  • date - shows the current date and time and you can also set the current date and time.
  • last - all the users that have logged into your system last.
[bk@rhel ~]$ whoami
bk

[bk@rhel ~]$ hostname
rhel

[bk@rhel ~]$ uname -a
Linux rhel 4.18.0-240.el8.x86_64 #1 SMP Wed Sep 23 05:13:10 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux

[bk@rhel ~]$ passwd
Changing password for user bk.

[bk@rhel ~]$ touch myfile.txt

[bk@rhel ~]$ date
Mon May 31 08:22:48 IST 2021

[bk@rhel ~]$ last
bk       pts/2        192.168.244.1    Mon May 31 06:24   still logged in
bk       pts/1        192.168.244.1    Sun May 30 20:45    gone - no logout
bk       tty2         tty2             Sun May 30 20:26    gone - no logout