Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash命令行中感叹号的含义_Bash_Shell_Command Line_Command Line Arguments - Fatal编程技术网

Bash命令行中感叹号的含义

Bash命令行中感叹号的含义,bash,shell,command-line,command-line-arguments,Bash,Shell,Command Line,Command Line Arguments,我在网上找到了这个命令,查找并显示指向text.txt等文件的硬链接 我的问题:感叹号(!)在这个命令中做什么 find $PWD ! -type d -links +1 -ls | sort -n|cut -d" " -f29 | grep --color=auto "$2" 这否定了下一个条件。所以-类型d表示“不是目录” 但是有一个问题:也是一个特殊字符,用于使bash进行历史扩展。这就是为什么您经常必须转义(…\!…)或引用它(…!“…) 另请参阅find手册(尝试manfind或in

我在网上找到了这个命令,查找并显示指向text.txt等文件的硬链接

我的问题:感叹号(!)在这个命令中做什么

find $PWD ! -type d -links +1 -ls | sort -n|cut -d" " -f29 | grep --color=auto "$2"

这否定了下一个条件。所以
-类型d
表示“不是目录”

但是有一个问题:
也是一个特殊字符,用于使bash进行历史扩展。这就是为什么您经常必须转义(
…\!…
)或引用它(
…!“…

另请参阅
find
手册(尝试
manfind
info find


这也被称为“砰”的一声,请尝试使用
man find
获取有关该命令语法的文档。例如,请查看(以及
find
的手册页)。请阅读、,然后在此处发布更多Qs。祝你好运。我只是在读,似乎真的需要单引号。。。(尤指bash4.3之前的版本)(可能有用)