利用type命令可以查询命令的类型,命令操作如下所示:
[root@localhost ~]# type echo echo is a shell builtin //builtin表示内部命令 [root@localhost ~]# type cd cd is a shell builtin [root@localhost ~]# type cat cat is /bin/cat //出现路径表示该命令为外部命令 [root@localhost ~]# type hostname hostname is /bin/hostname [root@localhost ~]#按Tab键不仅可以补全命令,也可以补全路径。要学好Linux必须学会使用Tab键所有要勤加练习。命令操作如下所示:
[root@localhost ~]# ls /et //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysco //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysconfig/netw //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysconfig/network- //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysconfig/network-scripts/ifc //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysconfig/network-scripts/ifcfg-e //输入路径到此处按Tab键 [root@localhost ~]# ls /etc/sysconfig/network-scripts/ifcfg-eth0 //实现补全Tab键特可以让我们变得更加轻松,记忆较长命令时可以只记住前半部分,可以利用Tab键显示出来。命令操作如下所示:
[root@localhost ~]# if //输入if都连续按两下Tab键 if ifcfg ifconfig ifdown ifenslave ifrename ifup [root@localhost ~]# fd //输入fd都连续按两下Tab键 fdformat fdisk命令操作如下所示:
[root@localhost ~]# shutdown \ //输入“\”换行 > -k \ //输入“\”换行 > now Broadcast message from root@localhost.localdomain (/dev/pts/0) at 19:05 ... The system is going down for halt NOW! [root@localhost ~]#