Boost Your Linux Productivity with 10 Essential Command‑Line Tools
This guide introduces ten lesser‑known Linux commands—including rsync, screen, lsof, vimdiff, netcat, and more—explaining their key options, practical use‑cases, and example invocations so you can work faster, automate tasks, and troubleshoot systems efficiently.
rsync vs scp
While scp copies files over SSH, it always transfers the full file set; rsync copies only changed files, making it ideal for incremental backups. Example:
scp -Crvp -l 1024 logs/ root@remoteServer:/opt/logsOptions: -C (compress), -r (recursive), -p (preserve attributes), -l (limit bandwidth in KB/s), -v (verbose).
For incremental, bandwidth‑limited copies with exclusions:
rsync -prz --exclude 'bin' --bwlimit=1024 logs/ root@remoteServer:/opt/logsOptions: -r (recursive), -p (preserve), -z (compress), --bwlimit (bandwidth), --exclude (skip files), --progress (show progress).
screen & tmux
When you need multiple persistent terminal sessions, screen (pre‑installed on many distros) lets you detach and reattach sessions. A typical workflow:
# 1. Start a screen session and run a command
screen vim /etc/hosts
# 2. Detach with Ctrl‑a d
# 3. List sessions
screen -ls
# 4. Reattach a specific session
screen -r 14000 tmuxoffers similar functionality with richer features but may require installation.
lsof
lsoflists open files, which on Unix includes network sockets and device handles. Useful filters: -p – specify PIDs (e.g., lsof -p 123,456) -i tcp – list TCP connections -i :8080 – show processes using port 8080
python -m shortcuts
Python can launch a quick HTTP server without extra software: python3 -m http.server 9080 This serves the current directory on port 9080.
For JSON pretty‑printing, use the built‑in tool:
python -m json.tool < input.jsonvimdiff
Vim can compare two files with colorized differences. Open both files: vim file1 file2 Navigation shortcuts: ]c – jump to next diff [c – jump to previous diff
netcat (nc)
ncis a versatile networking utility. Example of a reverse shell listener:
# Server side
nc -l -vv -p 5879 -e /bin/bashClient connects: nc -v 192.16.1.54 5879 To keep the listener alive after a client disconnects, add -k. Netcat can also test remote ports: nc -vvv baidu.com 443 And perform simple port scans:
nc -vzw 2 192.16.1.54 8888-9999Converting Unix timestamps
Use date to turn a epoch value into a readable string: date -d @1658054000 '+%Y-%m-%d %H:%M:%S' On macOS the flag is -r instead of -d :
date -r 1658054000systemctl service listing
To view all available services on a systemd host: systemctl -l -t service | less Mastering these commands can dramatically speed up everyday Linux tasks, reduce manual overhead, and give you finer control over remote systems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
