Operations 8 min read

11 Little‑Known Linux Commands That Supercharge Your Workflow

This article introduces a collection of lesser‑known Linux commands—such as sudo !!, python -m SimpleHTTPServer, mtr, Ctrl+x+e, nl, shuf, ss, last, curl ifconfig.me, tree, and pstree—explaining their purpose, typical use‑cases, and providing concrete examples to help both desktop users and system administrators work more efficiently.

ITPUB
ITPUB
ITPUB
11 Little‑Known Linux Commands That Supercharge Your Workflow

1. sudo !!

When a command fails due to missing privileges, you can re‑run it with sudo !! instead of re‑typing the entire command; !! expands to the previous command.

$ sudo !!

2. python -m SimpleHTTPServer

Starts a quick HTTP server that serves the current directory on port 8000, useful for sharing files locally.

# python -m SimpleHTTPServer
SimpleHTTPServer example
SimpleHTTPServer example

3. mtr

The mtr command combines ping and traceroute functionality. Install it with sudo apt-get install mtr on Debian‑based systems or yum install mtr on Red Hat‑based systems, then run mtr google.com to view the network path.

# sudo apt-get install mtr
# mtr google.com

4. Ctrl+x+e

Pressing Ctrl‑x e in the shell opens the last command in your default editor (vi, vim, nano, etc.), allowing quick edits before execution.

5. nl

The nl command adds line numbers to a file. Example with a file one.txt containing a list of distro names:

# cat one.txt
fedora
debian
arch
slack
suse

Running nl one.txt produces:

1  fedora
2  debian
3  arch
4  slack
5  suse

6. shuf

shuf

randomly shuffles lines from its input. Use it to pick a random file or line, e.g. ls | shuf -n1 selects one entry from the current directory. # ls | shuf -n1 Replace -n1 with -n2, -n3, etc., to select multiple random entries.

7. ss

ss

(socket statistics) displays detailed socket information, often more comprehensive than netstat. Example output shows TCP states, local/peer addresses, and ports.

# ss

8. last

The last command reads /var/log/wtmp to show recent login sessions, including user, tty, and timestamps.

# last

9. curl ifconfig.me

Retrieve your external IP address directly from the terminal with curl ifconfig.me. Install curl via the package manager if it is missing.

# curl ifconfig.me

10. tree

Display the directory hierarchy in a tree‑like format. Example output shows files and sub‑directories under the current folder.

# tree
.
|-- Desktop
|-- Documents
|   `-- 37.odt
|-- Downloads
|   `-- attachments.zip
|-- Music
|-- Pictures
|-- Public
|-- Templates
`-- Videos

11. pstree

pstree

visualises the process tree, showing parent‑child relationships of running processes in a format similar to tree.

# pstree
pstree example
pstree example

These commands, while not always covered in basic tutorials, can dramatically speed up everyday tasks for both novice and experienced Linux users.

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.

SysadminBashutilities
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

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.