命令的帮助信息
有两个命令可以查看此命令的帮助信息
- man + 命令
- 命令+ --help/-h (此命令只能查看系统内置命令)
查看命了是否为内置命令
[root@Zhang-linux ~]# type cd
cd is a shell builtin
[root@Zhang-linux ~]# type ifconfig
ifconfig is /usr/sbin/ifconfig
[root@Zhang-linux ~]#
命令详解地址
http://man.linuxde.net
http://liunx.web3.xin
http://linux.51yip.com
关机命令
| 关机/重启 命令 |
命令详解 |
| shutdown -h 0/now |
立刻关机 |
| shutdown -h 10 |
10分钟后关机 |
| shutdown -h 10:00 |
10:00 关机 |
| shutdown -r 0/now |
立刻重启 |
| shutdown -r 10 |
10分钟后重启 |
| shutdown -r 10:00 |
10:00 重启 |
| shutdown -c |
取消定时关机或重启 |
| poweroff |
立刻关机 |
| reboot |
立刻重启 |
| halt |
只关闭系统不关闭电源 |
| init 0 |
立刻关机 |
| init 6 |
立刻重启 |
| ctrl+d |
退出当前用户 |
| exit |
退出当前登录用户 |
| logout |
退出当前用户, 不能退出非登录shell |
显示ip地址命令
| 命令 |
命令详解 |
| ip address/a |
查看所有ip地址 |
| ip address show ens33 |
查看单个网卡信息命令 |
| ip a s ens33 |
同上 |
centos 6 默认查看网卡信息命令
[root@Zhang-linux ~]# yum install -y net-tools
| 命令 |
命令详解 |
| ifconfig |
查看所有网卡信息 |
| ifconfig ens33 |
查看单个网卡信息 |
查看主机名
| 命令 |
命令详解 |
| hostname |
查看主机名 |
| hostname -I |
显示ip地址 |
| hostname -i |
显示ip地址及网卡mac地址 |
[root@Zhang-linux ~]# hostname
Zhang-linux
[root@Zhang-linux ~]# hostname -I
10.0.0.100
[root@Zhang-linux ~]# hostname -i
fe80::4c2c:671:5a75:28f4%ens33 fe80::ae39:198:a8d1:748f%ens33 10.0.0.100
[root@Zhang-linux ~]#
| 命令 |
命令解释 |
| echo |
所见即所得 |
| echo + 字符串 |
打印字符串到屏幕上 |
| echo -e + 字符串 |
可以打印转义字符 |
| echo + 字符串 -> 123.txt |
将字符串写入到文件123.txt中覆盖原来的内天 |
| echo + 字符串 ->> 123.txt |
追加内容到123.txt |
| pwd |
查看当前目录路径 |
| cd |
切换目录 |