NOTE
Common Linux Commands
Linux commands inspect and manipulate files directly. These notes begin with text viewers such as cat and more and record common behavior and options.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Processes
1.1. top
1.2. vmstat
1.3. ps
1.4. pstree
1.5. ulimit
1.6. pidstat
2. Memory
2.1. free
3. Disk
3.1. df
3.2. iostat
3.3. lsof
3.4. strace
3.5. chroot
3.6. Text
- The cat command can display an entire file at once. If the file is relatively large, it is not very convenient to use.
- The more command can pause when the screen fills. Press Space to page forward and b to page backward.
- The less command can also display files page by page. The differences from more are:
- It supports scrolling with the up/down keys and searching.
- It does not need to read the entire file at the beginning, so it opens large files faster than more or vim.
- The head command is used to view the first n lines of a file.
- The tail command is used to view the last n lines of a file. With the
-foption, it is convenient for following live logs because it prints newly appended lines.- tail -f grep –color -A xxx -B xxx
3.7. Copying
3.7.1. rsync
4. Networking
4.1. ifstat
4.2. netstat
4.3. ifconfig
4.4. Test Host Connectivity
- curl tests HTTP.
curl https://www.baidu.com:443
- telnet tests TCP.
telnet www.baidu.com 80
4.5. traceroute
4.6. dig
4.7. nslookup
4.8. nethogs
4.9. sar
4.10. Packet Capture
5. References
- Troubleshooting Linux Performance Bottlenecks - CSDN
- Detailed Explanation of CPU Information in the Linux top Command - CNBlogs
- Tool Reference — Linux Tools Quick Tutorial
- Detailed Explanation of Linux ulimit | Otokaze’s Blog
- Summary of the Maximum Number of File Handles in Linux - ITeye
- Comparison of cat, less, more, head, and tail Commands - CSDN
- Difference Between buffer and cache Shown by vmstat - CSDN
- 008 Detailed Explanation of the top Command, Linux Basic Commands (4) - Bilibili
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub