Learn Useful Linux Commands for System Administrators
In this article, we are going to learn Useful Linux Commands for System Administrators that are utilized in their day by day life. This is anything but a total yet it’s a smaller rundown of commands to allude when required. Allow us to begin individually how we can utilize those commands with examples.
Follow the below Article for Useful Linux Commands for System Administrators:
1. Uptime Command
The Linux Operating System is loaded up with a few commands which any hopeful Linux master or power user for example system admin should have a decent handle of. One of such commands is uptime and today, I’ll momentarily examine its purpose and syntax.
Uptime Command In Linux: It is used to find out how long the system is active (running). This command returns a set of values that involve, the current time, and the amount of time the system is in running state, the number of users currently logged into, and the load time for the past 1, 5, and 15 minutes respectively.
# uptime 08:16:26 up 22 min, 1 user, load average: 0.00, 0.03, 0.22
2. W Command
w command in Linux is utilized to show who is signed on and what they are doing. This command shows the data about the users right now on the machine and their processes. The header shows, in a specific order, the current time, how long the system has been running, the number of users are right now signed on, and the system load averages for as far back as 1, 5, and 15 minutes. The accompanying passages are shown for every client: login name, the tty name, the distant host, login time, inactive time, JCPU, PCPU, and the order line of their present interaction. The JCPU time is the time utilized by all cycles joined to the tty. It does exclude past background jobs however incorporates right now running background jobs. The PCPU time is the time utilized by the current process, named in the “what” field.
w command gives information data about right now logged-in users.
$ w 11:24:37 up 2:04, 1 user, load average: 2.04, 1.95, 1.74 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT itsmarttricks tty7 :0 09:21 2:04m 7:52 0.52s xfce4-session
3. Users Command
Users command displays currently logged in users. This command don’t have other parameters other than help and version.
# users itsmarttricks
4. Who Command
who command just return user name, date, time and host information data. who command is like w command. Dissimilar to w command who doesn’t print what users are doing. Lets delineate and see the distinctive among who and w commands.
# who itsmarttricks pts/0 2021-09-18 07:59 (192.168.50.1)
# w 08:43:58 up 50 min, 1 user, load average: 0.64, 0.18, 0.06 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT itsmarttricks pts/0 192.168.50.1 07:59 0.00s 0.43s 0.10s w
Who command Options
- -b : Displays last system reboot date and time.
- -r : Shows current runlet.
- -a, –all : Displays all information in cumulatively.
5. Whoami Command
In computing, whoami is a command found on most Unix-like operating systems, Intel iRMX 86, every Microsoft Windows operating system since Windows Server 2003, and on ReactOS. It is a concatenation of the words “Who am I?” and whoami command print the name of current user. You can also use “who am i” command to display the current user. If you are logged in as a root using sudo command “whoami” command return root as current user. Use “who am i” command if you want to know the exact user logged in.
# whoami itsmarttricks
6. ls Command
ls command display list of files in human readable format.
# ls -l total 114 dr-xr-xr-x. 2 root root 4096 Sep 21 08:46 bin dr-xr-xr-x. 5 root root 1024 Sep 10 15:49 boot
Sort file as per last modified time.
# ls -ltr total 40 -rw-r--r--. 1 root root 6546 Sep 21 18:42 install.log.syslog -rw-r--r--. 1 root root 22435 Sep 21 18:45 install.log -rw-------. 1 root root 1003 Sep 21 18:45 anaconda-ks.cfg
For more examples of ls command, please check out our article on Best Linux Ls Command With Examples.
7. Crontab Command
List schedule jobs for current user with crontab command and -l option.
# crontab -l 00 10 * * * /bin/ls >/ls.txt
Edit your crontab with -e option. In the below example will open schedule jobs in VI editor. Make a necessary changes and quit pressing :wq keys which saves the setting automatically.
# crontab -e
8. Less Command
less command allows quickly view file. You can page up and down. Press ‘q‘ to quit from less window.
# less install.log Installing setup-2.8.14-10.el6.noarch warning: setup-2.8.14-10.el6.noarch: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY Installing filesystem-2.4.30-2.1.el6.i686 Installing ca-certificates-2010.63-3.el6.noarch Installing xml-common-0.6.3-32.el6.noarch Installing tzdata-2010l-1.el6.noarch Installing iso-codes-3.16-2.el6.noarch
Also Read – Learn Basic Linux System Commands For Linux Foundation Certified IT Associate (LFCA) Certification
That’s all, In this article, we have explained Useful Linux Commands for System Administrators. If you like this article, then just share it and then do subscribe to email alerts for Linux, Windows, macOS, Android, Internet, Firewall and Security, CCTV tutorials. If you have any questions or doubts about this article, please comment.