文章目录
-
-
- 基础命令
- 系统信息与管理命令
- 文件权限与所有权命令
- 网络管理命令
- 高级命令
-
- 31. `awk`
- 32. `sed`
- 33. `grep`
- 34. `strace`
- 35. `lsof`
- 36. `tcpdump`
- 37. `rsync`
- 38. `iptables`
- 39. `systemctl`
- 40. `journalctl`
- 41. `ncdu`
- 42. `vmstat`
- 43. `iostat`
- 44. `crontab`
- 45. `ufw`
- 46. `nc` (Netcat)
- 47. `tar`
- 48. `find`
- 49. `chmod`
- 50. `zip` 和 `unzip`
- 51. `mount` 和 `umount`
- 52. `rsyslog`
- 53. `dd`
-
基础命令
1. ls
功能:列出目录内容。
用法:
ls [options] [directory]
示例:
ls -lah
2. cd
功能:更改当前工作目录。
用法:
cd [directory]
示例:
cd /home/user/documents
3. pwd
功能:显示当前工作目录的路径。
用法:
pwd
示例:
pwd
4. cp
功能:复制文件或目录。
用法:
cp [options] source destination
示例:
cp -r dir1 dir2
5. mv
功能:移动或重命名文件或目录。
用法:
mv [options] source destination
示例:
mv oldname.txt newname.txt
6. rm
功能:删除文件或目录。
用法:
rm [options] file
示例:
rm -rf unwanted_directory
7. echo
功能:在终端打印文本或变量值。
用法:
echo [options] [string]
示例:
echo "Hello, World!"
8. cat
功能:连接文件并在终端输出内容。
用法:
cat [options] [file]
示例:
cat file.txt
9. head
功能:输出文件的前部分内容。
用法:
head [options] [file]
示例:
head -n 10 file.txt
10. tail
功能:输出文件的后部分内容。
用法:
tail [options] [file]
示例:
tail -n 10 file.txt
系统信息与管理命令
11. ps
功能:显示当前运行的进程。
用法:
ps [options]
示例:
ps -ef
ps -ef | grep nginx
ps aux
ps aux | grep nginx
12. top
功能:实时显示系统任务信息。
用法:
top
示例:
top
13. htop
功能:交互式的系统监控工具,比 top
更友好。
用法:
htop
示例: