Linux Commands That Every Linux System Administrator Should Know with Examples Part-3

This is the Part-3 of our ongoing series of Linux commands. We have covered Linux commands Part-1 & Part-2 in our earlier tutorials.

Let’s get started.
1. vi command with example
vi (Visual) is the default text editor in Unix and Unix like Operating System. Using vi editor, you can create a file and edit a existing file.

Syntax:
vi filename
In the following example, we are creating a file name teclues using vi editor and :wq! (write/save and quit).
$ vi teclues



There are 3 modes of operations in vi.

. Escape Mode – This mode is to perform tasks such as save a file, execute commands etc.
. Insert Mode – This mode is to insert text in the file. Press ‘i’ on the keyboard to change mode into insert mode.
. Command Mode – In this mode you can move the cursor and cut, copy and paste the text.

2. watch command with example
watch command runs repeatedly. By default, watch command run every 2 seconds and command will run until you interrupt.

Syntax:
watch [options] command
Example:
$ watch date
Output of command


3. YUM or DNF command example
YUM (Yellow Update Manager) is a package manager for RPM-based Linux distributions. DNF is the successor of YUM. DNF (Dandified YUM) is the next generation version of YUM. DNF is the default package manager tool for Fedora 18 and later versions, Red Hat Linux 8, CentOS 8, OEL 8  
Syntax:

yum [options] [command] [package …]
$ sudo dnf install bind
Output: Installing BIND package using yum command.
$sudo dnf install vsftpd
Output: Installing vsftpd package using dnfcommand.
5. uptime command with examples
uptime command to find how long your system is up and running also displays date, time, number of users login and load average as well.
Syntax:
uptime [options]
$ uptime


6. top command with examples
7. ln command with examples

ln command is used to create Hard and Soft links in Linux.
Hard Link – Hard Link is an additional name for an existing file with the same inode.
Soft Link – Soft Link is like a shortcut in Windows OS. Soft Link or Symlink can point to a file or a directory on a different filesystem or partition.
Syntax for Soft Link :
ln -s [OPTIONS] FILE LINK
In the following example, we are creating a symlink named mylink.py to a file named softlink.py:
$ ln -s softlink.py  mylink.py
8. sudo command with example
SUDO (Super User DO) command allows a permitted user to execute a command as another user as per security policy defined. To execute sudo command need to have an entry in the sudoers file for a user.
Syntax:
sudo [command]
$ sudo dnf update

9. rpm command with example
RPM (RedHat Package Manager) is used for installing, querying, updating, removing packages in RPM-based Linux Operating System.
Syntax to install the package:
rpm -ivh {rpm-file}
$ rpm -ivh telnet-0.17-64.el7.x86_64.rpm
10. gzip command with example
gzip command is to compress files and folder and add a “.gz” suffix in a file.
Syntax:
gzip [Options] [filenames]
In the following example, we are compressing two test.img & test.txt
$ gzip -k test.img test.txt

11. gunzip command with example
Decompressing the compress file which was compressed in point no. 10 as above this will replace the compressed file with the original file name by default. However, you need to confirm before replacing.
Syntax:
gunzip [Option] [archive name/file name]
In the following example, we are decompressing two test.img.gz & test.txt.gz files.
$ gunzip test.img.gz test.txt.gz

12. chage command with example
13. tee command with example
tee command to read from standard input and writes to both standard output and a file at the same time.

Syntax:
tee [OPTIONS] [FILE]
In the following example, displays below command output in a screen and at the same time it will write into a file called disk_usage.txt.
$ df -hT | tee disk_usage.txt
14. tac command with example
tac command is used to concatenate and print files in reverse.
Syntax:
tac [OPTION]… [FILE]…

15. dmesg command with example
dmesg command also called driver message or display message print or control the kernel ring buffer, this command contains the messages produced by the device drivers.
Syntax:
dmesg [options]
$ dmesg | grep “usb”


In this post, we have covered 15 Linux command that Every Linux System Administrator Should Know With Examples. We will be covering another series of commands in the next articles. Stay tuned !!! Also share it with others and also like our facebook official page.

Leave a Comment