查看命令的类型:type
[[email protected] ~]# type cd cd is a shell builtin [[email protected] ~]# type ls ls is aliased to `ls --color=auto‘ [[email protected] ~]# type -a ls ls is aliased to `ls --color=auto‘ ls is /bin/ls [[email protected] ~]#
查看系统上是否有内建命令处于关闭状态:enable -n
[[email protected] ~]# enable -n [[email protected] ~]# # 这里没有处于禁用状态的shell内建命令。
关闭指定的shell内建命令:enable -n <command_name>
[[email protected] ~]# enable -n cd [[email protected] ~]# enable -n enable -n cd [[email protected] ~]# cd -bash: cd: command not found [[email protected] ~]#
重新启用处于禁用状态的shell内建命令:enable <command_name>
[[email protected] ~]# enable cd [[email protected] ~]# enable -n [[email protected] ~]# cd [[email protected] ~]# cd /var [[email protected] var]#
时间: 2024-11-08 05:12:16