Essential Linux Commands Every Developer Should Master
This guide introduces the most commonly used Linux commands—including navigation, file listing, searching, process management, and system monitoring—explaining their syntax, useful options, and practical examples to help developers work efficiently in a Linux environment.
Basic Navigation Commands
cd – Change Directory cd .. Return to the parent directory cd . Enter the current directory (no effect) cd - Return to the previous directory (not necessarily the parent)
Listing Files and Directories
ls – List Files
Usage: ls [options] [file] Common options: ls -l Show permissions and attributes ls -a List all files, including hidden ones ls -h Display sizes in human‑readable format (GB, kB, etc.) ls -al Combine -a and
-lViewing Detailed File Information
stat – Show File Details
Displays permissions, attributes, size, modification time, access time, and more—more detailed than ls -l.
Usage:
stat filenameSearching Text Within Files
grep – Text Search/Filter
Usage: grep [options] pattern [file] (often combined with pipes)
Common options: -i Case‑insensitive search -v Invert match (show lines that do NOT contain the pattern) -c Count matching lines -n Show line numbers
Finding Files
find – Locate Files
Usage: find [PATH] [options] [-print] Key options: -name filename Find files by name -perm Search by permission bits -user username Search by file owner -group groupname Search by group -mtime -n / -mtime +n Modified within n days or older than n days -ctime -n / -ctime +n Created within n days or older than n days -size +-n[c] File size greater or less than n blocks/bytes
Examples:
Find all .log files under /tmp:
Find files in /proc with permission 777 and containing "root":
Find files created by user root under /tmp:
Find files in /tmp modified within the last day:
Find files smaller than 72 bytes in /tmp:
Process Management
ps – Snapshot of Processes
Shows currently running processes and their status; does not update continuously.
top – Real‑Time Process Monitor
Continuously displays CPU, memory, and load usage per process.
Common options: -d seconds Refresh interval -i Hide idle or zombie processes -n NUM Number of updates before exiting -p PID Monitor a specific PID -H -p PID Show threads of a process
Killing Processes
kill – Terminate by PID
Usage: kill [-signal] PID (default signal is TERM; -9 forces termination)
killall – Terminate by Name
Usage: killall process_name kills all processes matching the name.
Other Useful Commands
pwd – Print Working Directory
Displays the current directory path.
help / man – Command Help
Use command --help or man command to view usage information.
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
