DEV Community

Cover image for Hidden Linux Gems: 15 Lesser-Known Commands That Deserve More Attention
Asep Sayyad
Asep Sayyad

Posted on • Originally published at Medium

Hidden Linux Gems: 15 Lesser-Known Commands That Deserve More Attention

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
Enter fullscreen mode Exit fullscreen mode

Most people know man, but tldr provides practical examples instead
of long documentation.

Install:

sudo apt install tldr
Enter fullscreen mode Exit fullscreen mode

2. ss --- Better Than netstat

ss -tulnp
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Runs free -h every 2 seconds.

Great for monitoring: - Memory - Disk usage - Processes


5. Discover Binary Dependencies

ldd /bin/ls
Enter fullscreen mode Exit fullscreen mode

Shows which shared libraries a program depends on.

Very useful when debugging missing library errors.


6. Trace What a Program Is Doing

strace ls
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Find which process is using port 80.

Another example:

lsof /var/log/syslog
Enter fullscreen mode Exit fullscreen mode

Shows which process currently has the file open.


8. Inspect Binary Strings

strings binary_file
Enter fullscreen mode Exit fullscreen mode

Extracts readable text from compiled binaries.

Useful for: - Reverse engineering - Malware analysis - Debugging


9. Hex Dump Any File

xxd file.txt
Enter fullscreen mode Exit fullscreen mode

Displays hexadecimal representation.

Restore:

xxd -r dump.hex restored.bin
Enter fullscreen mode Exit fullscreen mode

10. View ELF Information

readelf -h /bin/bash
Enter fullscreen mode Exit fullscreen mode

Shows:

  • Architecture
  • Entry point
  • ELF headers

Very useful for Linux internals.


11. Find Slow DNS Lookups

dig openai.com
Enter fullscreen mode Exit fullscreen mode

Instead of relying on ping, use dig to troubleshoot DNS.


12. Show Process Tree

pstree -p
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

or

clear
Enter fullscreen mode Exit fullscreen mode

reset completely reinitializes the terminal if it becomes corrupted.


15. Explore Without Installing Anything

python3 -m http.server 8000
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Automatically stops a command after 5 seconds.


yes "Hello"
Enter fullscreen mode Exit fullscreen mode

Outputs text continuously until stopped.

Useful for testing scripts.


column -t file.txt
Enter fullscreen mode Exit fullscreen mode

Formats messy text into neat columns.


script session.log
Enter fullscreen mode Exit fullscreen mode

Records your entire terminal session.


history | grep docker
Enter fullscreen mode Exit fullscreen mode

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)