介绍两个命令
[[email protected] ~]# shopt autocd off cdable_vars off cdspell off checkhash off checkjobs off checkwinsize on cmdhist on compat31 off ...
[[email protected] ~]# help shopt shopt: shopt [-pqsu] [-o] [optname ...] Set and unset shell options. Change the setting of each shell option OPTNAME. Without any option arguments, list all shell options with an indication of whether or not each is set. Options: -o restrict OPTNAMEs to those defined for use with `set -o' -p print each shell option with an indication of its status -q suppress output -s enable (set) each OPTNAME 开启功能 -u disable (unset) each OPTNAME 关闭功能 Exit Status: Returns success if OPTNAME is enabled; fails if an invalid option is given or OPTNAME is disabled.
!
。?(pattern-list) 匹配给定模式零或一次 *(pattern-list) 匹配给定模式零次或多次 +(pattern-list) 匹配给定模式一次或多次 @(pattern-list) 匹配给定模式之一 !(pattern-list) 匹配除了给定的模式
mv !(a|dir) dir # 将当前目录内除了a的所有文件移入dir文件夹 rm !(*.txt) # 删掉除了txt后缀的全部文件