10 Useful Linux Commands for the System Administrators

Linux commands for system administrators

Here are 10 basic Linux commands for the system administrators. These commands are important when it comes to everyday usage.

Linux commands are essential when it comes to any Linux-based operating system. One cannot think of Linux without commands and there are a lot of them. Some are important and used every day and some are not so important but you will need them at some point. We can still use it on GUI with no problem but for administrators, Linux commands are lifelines. So here are 10 basic commands for the system administrators.

Also Read:

Here are 10 commands for Linux beginners: 10 Basic Linux Commands For Beginners and beginners guide to Linux: How to Get Started with Linux: A Beginners Guide

10 Linux Commands For System Administrators

In this post, we will discuss 10 commands that Linux system administrators use in everyday life. These commands are easy to use and will be great introductory commands for beginners. Even for advanced users, these commands are essential and you might find yourself using these every day. So let us get started.

Find Logged in users and their activity

You can use these Linux commands to see current user activity and load status. There are different commands for this but the commands below are the easy way to check this.

Whoami Command

whoami

 

As the name suggests, this command is used to see the current user status. It simply displays the name of the current user. It is similar to the command id -un but easy to write and remember.

  • You can use this command to see the version of whoami.

 

whoami --version

This will give you the version information.

W Command

 

w

This Linux command also gives information about current users. Unlike the whoami command, this will give you some advanced information. This command will show the current users and their processes on the system, how many users are currently logged in, system uptime, idle time, CPU and GPU info, and much more. Here is how you can use different variations of Linux commands to get information about your machine.

 

  • With this, you can see all the syntax you can use with thecommand.

 

w --help

  • To only display the IP address.

w -i

  • display information about a specific user.

w user

  • To display CPU uptime on the current process

w -u

SSH Command

SSH is a short form for Secure Shell. One of the most important Linux commands it comes to establish a secure connection between two hosts. There are a lot of insecurities when it comes to the internet. It becomes more of a concern when you are trying to connect to a remote server.

Here, SSH comes into play. It secures the connection between host and client by encryption. Below are examples of how you can use this command.

Different attributes to use with the SSH command.

  • Start an SSH session

ssh

  • To check your version of the SSH

ssh -v

  • Use IPV4 connection in a session

ssh -4

  • USe IPV6 connection in a session

ssh -6

  • Use gzip compression data transfer between host and remote server

ssh -c

  • To specify the user name

ssh -l login_name

  • To stop remote servers from executing commands

ssh -N

  • Display all the options from the configuration file

ssh -o option

  • Enable X11 forwarding

ssh -X

  • disable X11 forwarding

ssh -x

These were the most used SSH commands in a session. If you want the full list of SSH Linux commands then check this list of all available commands.

 

File Transfer Protocol or FTP

You can use these Linux commands to transfer files between remote systems. FTP is the basic protocol to transfer files from a remote machine. You can use this command to connect to a remote system and upload and download files. Only use this command to connect to a trusted remote server because this command is not secured. It doesn’t use any encryption. To connect securely, use the SFTP or SCP command.

FTP

  • To use this command type FTP in the terminal with the address to the remote system

ftp://speedtest.tele2.net

or

ftp {address}

SFTP

This command is the same as FTP but used to establish a secure connection.

  • To use this command:

sftp {address}

 

Top Command

Next in the list of Linux commands is TOP. This command shows all the processes in a Linux machine. Not only that, but it also shows current resource usage and what process is using what resource. It is a useful command when you want to find out the culprit which is slowing down your PC.

You can use keyboard shortcut keys after executing the top command to perform different tasks. Like, pressing k to quit, press z to highlight running processes, press c to see the absolute path of running processes. Below are the different attributes you can use with the top command.

  • Processes of a specific user

top -u {username}

  • To turn on batch mode

top -b

  • Enable secure mode

top -s

  • Show current command syntax

top -h

Tar Command

Tar is very important in this list of Linux commands. When you are a system administrator, you need to deal with lots of files that come in different sizes. Some files occupy a big chunk of storage. You can use the tar command to compress these files. Below are the basic attributes you need to know to create an archive.

  • -c attribute creates an archive.
  • -v will display information about the archive.
  • -f is used to create an archive with a file name
  • -x is used to extract an archive 
  • To create an archive

tar -cvf archive-name.tar /directory 

  • To extract an archive

tar -xvf archive-name.tar

  • -z use gzip to create the file.

 

GREP command

This is one of the most used commands in all Linux commands. The Grep command is used to search a particular file, files with mentioned strings or file format, and much more. Here is how you can use this command.

grep {option} {varibale or pattern} {file}

For example, if I want to find my name in a name list.

grep -i bhanu name list

  • -i is used to ignoring case sensitive
  • -w is used to print the lines in which given quarry matches.
  • -r is used to add all the sub-directories in the search.
  • -v is used to exclude the lines which match the given search quarry.

 

Ls Command

Everyday user or system administrator, this is commonly used on an everyday basis. Its functionality which is to list directory and file makes it one useful command. This command can show you files and directories in the current location as a list in the terminal. To use this command, simply go to the terminal and type ls.

ls

Important attributes to use with ls command

  • –version shows the current version of the ls command.
  • -n displays the UID of the files.
  • -a view hidden files.
  • -LS shorts the files by their size.
  • –help brings up help page of ls command.

 

Crontab Command

The Crontab command is used to bring up the cron table for editing, in which all schedules for the current users are listed. To use this command, type the following command in the terminal:

crontab -l

these are some attributes you can use with the crontab command.

  • -u user to specify the for which you want to use the command.
  • -l shows the current crontab schedule file.
  • -e to edit the crontab with editor specified by the user.
  • -r removes current crontab.

So these were 10 useful Linux commands that might come in handy for system administrators. These are some basic commands that we find ourselves using every day.

Posted by
Bhanu Sharma

I am a graduate in B.Sc. physics but I was always passionate about technology. It all started when I got my hands on my first smartphone and PC. Now, here I am always looking for new gadgets and technological advancement. I always happy to write new articles on how tos. I fell like i am in my element. I hope you all get help and knowledge from my work.