linux下常用命令
修改文件类型
- dos2unix +文件名
类如 demo.conf 文件是Windows格式的,执行 dos2unix demo.conf 命令,就能将demo.conf文件变成unix格式的。
查看系统类型
- lsb_release -a
- cat /etc/issue
更改hosts配置
- vi /etc/hosts
- /etc/init.d/networking restart
重启更改后的hosts文件
更改机器名
- vi /etc/hostname
添加你要改的名字 eg:guanh - vi /etc/hosts
将127.0.0.1后面对应的改成guanh - sudo hostname -F /etc/hostname