linux常用命令
基于centos 以我自己实际使用情况来说,从最常用的开始开始,大致如下:
1. 基本命令
- cd
- ls
- ll(ls -l 别名 )
- cat
- vi/vim
- touch
- echo
- mkdir
- tail
- grep
- chmod
- rm
- rm -rf 测试环境中用的多,生产环境避免使用
- cp
- mv
- grep
- find
2. 系统状态,系统配置
- ifconfig 网络
- netstat
- ps
- top
- systemctl
- fdisk
- df
- du
- mount
- ping
- telnet
- iptables
- ip
3.常用的配置文件
- 网络: vim /etc/sysconfig/network-scripts/ifcfg-ensXXX(不同系统文件名可能不一样,centos7 新的网络接口配置文件命名规则,不再使用eth0类似的命名规则
- 主机名: vim /etc/hostname
- 文件挂载: vim /etc/fstable
- 日志: tail -f /var/log/messages
- 系统参数 vim /etc/sysctl.conf
- DNS : vim /etc/resolv.conf 一般不推荐直接在这个文件是配置,应该在网络接口配置文件中设置
- 个人环境变量设置: $HOME/.bash_profile 环境变量还有其它文件可以配置,比如.baskrc 不同的文件加载顺序有区别。