Operations 9 min read

10 Lesser-Known Linux Commands Every Sysadmin Should Master

This article introduces ten useful but often overlooked Linux commands—pgrep, pstree, bc, split, nl, mkfifo, ldd, col, xmlwf, and lsof—explaining their purpose, typical use cases, and providing concrete examples to help system administrators work more efficiently.

Programmer DD
Programmer DD
Programmer DD
10 Lesser-Known Linux Commands Every Sysadmin Should Master

1) pgrep

The pgrep command lists process IDs matching a pattern, similar to ps -ef | egrep '^hchen' | awk '{print $2}'.

$ pgrep -u hchen
22441
22444

2) pstree

pstree

displays the process hierarchy in a tree format.

[hchen@RHELSVR5 ~]$ pstree
init-+-acpid
     |-auditd-+-python
     ... (truncated tree output) ...

3) bc

bc

is a high‑precision calculator useful for arithmetic such as square‑root calculations. Example script sqrt:

#!/bin/bash
if [ $# -ne 1 ]
then
    echo 'Usage: sqrt number'
    exit 1
else
    echo -e "sqrt($1)
quit
" | bc -q -i
fi

Usage:

[hchen@RHELSVR5]$ ./sqrt 36
6
[hchen@RHELSVR5]$ ./sqrt 2.0000
1.4142

4) split

split

divides a large file into smaller pieces.

[hchen@RHELSVR5 applebak]# ls -l largefile.tar.gz
-rw-r--r-- 1 hchen hchen 436774774 04-17 02:00 largefile.tar.gz

[hchen@RHELSVR5 applebak]# split -b 50m largefile.tar.gz LF_

[hchen@RHELSVR5]# ls -l LF_*
-rw-r--r-- 1 hchen hchen 52428800 LF_aa
-rw-r--r-- 1 hchen hchen 52428800 LF_ab
... (other parts) ...

Reassemble with:

# cat LF_* > largefile.tar.gz

5) nl

nl

numbers the lines of a file, similar to cat but with line numbers.

[hchen@RHELSVR5 include]# nl stdio.h | head -n 10
 1  /* Define ISO C stdio on top of C++ iostreams.
 2  Copyright (C) 1991,1994-2004,2005,2006 Free Software Foundation, Inc.
 3  This file is part of the GNU C Library.
 ...

6) mkfifo

mkfifo

creates a named pipe.

[hchen@RHELSVR5 ~]# mkfifo /tmp/hchenpipe

[hchen@RHELSVR5 ~]# ls -l /tmp
prw-rw-r-- 1 hchen hchen 0 Apr 5 18:58 hchenpipe

Writing to the pipe blocks until another process reads from it:

# ls -al > /tmp/hchenpipe   # blocks
# head /tmp/hchenpipe      # reads and unblocks

7) ldd

ldd

shows the shared libraries required by an executable.

[hchen@RHELSVR5 ~]# ldd /usr/bin/java
linux-gate.so.1 => (0x00cd9000)
libgij.so.7rh => /usr/lib/libgij.so.7rh (0x00ed3000)
... (other libraries) ...

8) col

col

converts man page output to plain text.

# PAGER=cat
# man less | col -b > less.txt

9) xmlwf

xmlwf

validates an XML file.

[hchen@RHELSVR5 ~]# curl 'https://coolshell.cn/?feed=rss2' > cocre.xml
... download output ...
[hchen@RHELSVR5 ~]# xmlwf cocre.xml
cocre.xml:13:23: mismatched tag

10) lsof

lsof

lists open files; useful for finding which processes are using network ports.

[root@RHELSVR5 ~]# lsof | grep TCP
httpd 548 apache 4u IPv6 14300967 TCP *:http (LISTEN)
sshd 1764 root 3u IPv6 4993 TCP *:ssh (LISTEN)
... (other entries) ...
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxUnixSysadminBashcommand-line
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.