Linux for Developers: The Essential Commands You’ll Actually Use

Linux command-line proficiency is one of the highest-leverage skills for software developers — most servers run Linux, containers run Linux, and the tools that matter (git, Docker, ssh, make) work best in a Unix environment. Here is what you actually need.

File Operations

ls -la              # list all files including hidden, with permissions
find . -name "*.py" # find files by pattern recursively
grep -r "function" . # search content recursively
cp -r src/ dst/     # recursive copy
mv file.txt dir/    # move or rename
rm -rf directory/   # recursive delete (irreversible — be careful)
cat file.txt        # print file contents
less file.txt       # page through large files (q to quit)

Process Management

ps aux | grep python   # find processes by name
kill -9 PID           # force-kill a process by PID
top / htop            # live process monitor (htop is better)
nohup ./script.sh &   # run in background, survive logout
systemctl status nginx # check service status
journalctl -f         # follow system logs

Networking

curl -I https://example.com  # check HTTP headers
wget https://example.com/file.tar.gz  # download file
ssh user@host -p 2222  # SSH with custom port
scp file.txt user@host:/tmp/  # copy file to remote
netstat -tlnp | grep :8080  # check what's on a port
ss -tlnp               # modern replacement for netstat

Text Processing

awk '{print $2}' file.txt  # print second column
sed 's/old/new/g' file.txt  # find-replace in file output
sort -u file.txt            # sort and deduplicate
wc -l file.txt             # count lines
head -20 file.txt / tail -20 file.txt  # first/last 20 lines
jq '.data[]' file.json    # process JSON (install separately)

The Three Commands That Matter Most

Learn these first: man command (read the manual for any command), ctrl+r (search command history backwards), and | (pipe output of one command to input of another). Chaining commands with pipes is what makes the Unix command line genuinely powerful.

上一篇 德国医疗体系:生病了实际上会发生什么
下一篇 开发者的Linux入门:你真正会用到的核心命令