Linux 命令大全
Linux 命令是 Linux 操作系统中最基本也是最重要的组成部分,它们可以帮助用户管理和维护 Linux 系统。本文档记录了常用的 Linux 命令,涵盖了文件管理、网络管理、系统管理、安全管理等多个方面的命令。
**文件管理命令**
1. find 命令:find 命令用于查找文件,例如 find /-name MP_20140320.txt 查找名为 MP_20140320.txt 的文件。
2. tar 命令:tar 命令用于压缩和解压缩文件,例如 tar -cvf file.tar file.gz 将 file.gz 文件压缩到 file.tar 中。
3. mv 命令:mv 命令用于移动或重命名文件,例如 mv my1.txt my2.txt 将 my1.txt 文件重命名为 my2.txt。
4. grep 命令:grep 命令用于搜索文件中的字符串,例如 grep -n 600 PAYM020120140415160531S310000162 mpCore_2014-04-15.log --color 搜索文件中的字符串。
**网络管理命令**
1. sftp 命令:sftp 命令用于安全文件传输,例如 sftp service vsftpd start 启动 sftp 服务。
2. curl 命令:curl 命令用于下载文件,例如 curl ifconfig.me 下载网络配置文件。
**系统管理命令**
1. ifconfig 命令:ifconfig 命令用于配置网络接口,例如 ifconfig eth0 192.168.1.100 设置网卡的 IP 地址。
2. free 命令:free 命令用于显示系统的内存和交换空间使用情况,例如 free -h 显示系统的内存和交换空间使用情况。
3. top 命令:top 命令用于显示系统的进程列表,例如 top 显示系统的进程列表。
4. uptime 命令:uptime 命令用于显示系统的运行时间,例如 uptime 显示系统的运行时间。
5. vmstat 命令:vmstat 命令用于显示系统的虚拟内存统计信息,例如 vmstat 显示系统的虚拟内存统计信息。
**安全管理命令**
1. chmod 命令:chmod 命令用于设置文件的权限,例如 chmod +x xxxx.sh 设置文件 xxxx.sh 的可执行权限。
2. passwd 命令:passwd 命令用于设置用户密码,例如 passwd lizhipeng 设置用户 lizhipeng 的密码。
3. chown 命令:chown 命令用于设置文件的所有权,例如 chown -R lizhipeng:lizhipeng 设置文件的所有权。
4. ln 命令:ln 命令用于创建文件的链接,例如 ln -s /data/pictures/promotion /data/pictures/promotion 创建文件的软链接。
**其他命令**
1. ctrl+u 命令:ctrl+u 命令用于删除当前行,例如 ctrl+u 删除当前行。
2. zip 命令:zip 命令用于压缩文件,例如 zip file.zip file 将 file 文件压缩到 file.zip 中。
3. unzip 命令:unzip 命令用于解压缩文件,例如 unzip file.zip 解压缩 file.zip 文件。
4. nginx 命令:nginx 命令用于管理 nginx 服务,例如 nginx -s reload 重新加载 nginx 配置文件。
本文档记录了常用的 Linux 命令,涵盖了文件管理、网络管理、系统管理、安全管理等多个方面的命令。这些命令可以帮助用户更好地管理和维护 Linux 系统。