There are no "secret" Linux commands hidden from experienced users.
However, there are many excellent commands that are surprisingly
underused. These can make you more productive and deepen your
understanding of Linux.
1. tldr --- Simpler Than man
tldr tar
Most people know man, but tldr provides practical examples instead
of long documentation.
Install:
sudo apt install tldr
2. ss --- Better Than netstat
ss -tulnp
Shows: - Listening ports - Process IDs - Active TCP/UDP sockets
Why use it?
ss is faster and is the modern replacement for netstat.
3. Find the Largest Files
du -ah / | sort -rh | head -20
Explanation:
-
du -ah→ Calculate file sizes -
sort -rh→ Sort by largest first -
head -20→ Show only the top 20
Useful when a server suddenly runs out of disk space.
4. Watch a Command Continuously
watch -n 2 free -h
Runs free -h every 2 seconds.
Great for monitoring: - Memory - Disk usage - Processes
5. Discover Binary Dependencies
ldd /bin/ls
Shows which shared libraries a program depends on.
Very useful when debugging missing library errors.
6. Trace What a Program Is Doing
strace ls
You'll see every system call the program makes.
This is one of the best debugging tools available.
7. See Open Files
lsof -i :80
Find which process is using port 80.
Another example:
lsof /var/log/syslog
Shows which process currently has the file open.
8. Inspect Binary Strings
strings binary_file
Extracts readable text from compiled binaries.
Useful for: - Reverse engineering - Malware analysis - Debugging
9. Hex Dump Any File
xxd file.txt
Displays hexadecimal representation.
Restore:
xxd -r dump.hex restored.bin
10. View ELF Information
readelf -h /bin/bash
Shows:
- Architecture
- Entry point
- ELF headers
Very useful for Linux internals.
11. Find Slow DNS Lookups
dig openai.com
Instead of relying on ping, use dig to troubleshoot DNS.
12. Show Process Tree
pstree -p
Displays parent and child processes in a tree.
Much easier than reading ps.
13. Follow Multiple Logs
multitail /var/log/syslog /var/log/auth.log
Unlike tail -f, this lets you watch several log files simultaneously.
14. Recover Deleted Terminal Output
Accidentally cleared your terminal?
Instead of reopening it:
reset
or
clear
reset completely reinitializes the terminal if it becomes corrupted.
15. Explore Without Installing Anything
python3 -m http.server 8000
Instantly creates a web server in the current directory.
Perfect for: - Sharing files - Testing websites - Development
Bonus Commands Worth Learning
timeout 5 ping google.com
Automatically stops a command after 5 seconds.
yes "Hello"
Outputs text continuously until stopped.
Useful for testing scripts.
column -t file.txt
Formats messy text into neat columns.
script session.log
Records your entire terminal session.
history | grep docker
Search your shell history instantly.
Final Thoughts
None of these commands are "secret." They are simply underused. Learning
them won't replace Linux fundamentals, but they'll make you a more
capable troubleshooter and system administrator.
Top comments (0)