Linux Commands That Every Linux System Administrator Should Know With Examples Part-4

This is the part-4 of our ongoing Linux Command Series tutorial. In this tutorial, we are going to cover Advanced Level of Linux Commands. we have covered beginner to advanced level Linux commands in our previous Linux Command Tutorials.
Also Read:

Let’s get started.
1. blkid command with example
blkid command print information about block device attributes. The blkid command display attributes like UUID, File system type, Volume label.

$ blkid

2. lsblk command with examples
lsblk list block devices in a tree-like format by default. It will displays  the device name (NAME), major and minor device number (MAJ:MIN), if the device is removable (RM), size of the device (SIZE), if the device is read-only (RO), type of device (TYPE) and mount point (MOUNTPOINT).  “lsblk –help” to get a list of all available columns.
$ lsblk
3. findmnt command with example
findmnt command display list of currently mounted file systems with details like target mount point (TARGET), source device (SOURCE), file system type (FSTYPE), mount point options (OPTIONS)
$ findmnt
4. fdisk command with example
fdisk command is a menu-driven interactive utility for creation and manipulation of partition tables. fdisk allows you to create four primary partition and number of logical partition depends on the size of your hard disk. The following command is used to list the partitions on your system.
$ sudo fdisk -l


5. parted command with example


parted command to create or manage disk partitions interactively. parted command allow user to create a partition when the disk size larger than 2TB and it supports GPT (GUID Partition Tables) partitions.


Following command to lunch parted console.


$ sudo parted


6. mkfs command with example
mkfs (Make File System) command is used to build a Linux File System on a device or a hard disk partition.
Cautions: Creating a file system on a partition is destructive to any partitions and may erase data reside on partitions. So, kindly use it on spare or test system before doing it on production.
In the following command we are formatting and creating EXT4 file system.
$ sudo mkfs.ext4 /tmp/teclues.img
7. lscpu command with example
lscpu command shows information about the CPU architecture that are present in the system, including the number of CPUs, Architecture, Vendor, Family, Model, CPU Caches etc.
$ lscpu
8. lspci command with example
lspci command displays information about PCI buses and devices that are attached to the system. To list all PCI devices are in the system, type the following command.
$ lspci
9. lshw command with example
lshw (Hardware Lister) command line utility generates comprehensive report about various hardware attached on the system like memory configuration, firmware version, main-board configuration, CPU version and speed, cache configuration, bus speed etc.
List hardware in a compact format.
$ sudo lshw -short
10. lsof command with example
lsof “List of Open Files” command list files that are opened by process and this can be different type of files like a directory, a block special file, a shared library, a character special file, a regular pipe, a named pipe, an internet socket, a UNIX domain socket etc.
Following command list open files for users “teclues”
$ lsof -u teclues | more
11. ps command with example
ps (Process Status) command line utility is used to display currently running processes along with their PIDs and other attributes on the system.
ps [options]
$ ps -ef |more
UID – User ID
PID – Unique process ID
PPID – Parent Process ID
TTY – terminal type that the user is logged in
TIME – amount of CPU in minutes and seconds that the process has been running
CMD – name of the command that launched the process.
12. pstree command with example
pstree (Process Tree) command also shows the running process on your system but it shows in a tree-like format and makes the output more visually appealing. Sometime it may be helpful to view the directory structure in a hierarchical way.
pstree [OPTIONS]
$ pstree
In this tutorial, we have covered some Advanced Level Linux Commands which may be useful in your daily tasks. Please share it with others and like our facebook page.


Leave a Comment