linux命令上的“查找”和“查找/”之间有什么区别

问题描述

我正在解决强盗。我看了解决方法,但没有任何解释。 例如,当我使用find .在强盗5-> 6

上找到它时
bandit5@bandit:~/inhere$ find . -type f -readable ! -executable -size 1033c
**./maybehere07/.file2**

bandit5@bandit:~/inhere$ cat ./maybehere07/.file2
**DXjZPULLxYr17uwoI01bNLQbtFemEgo7**

我在强盗6上使用了find . 6->我没有得到任何输出 在他们用find /

解决解决方案中
bandit6@bandit:~$ find /  -user bandit7 -group bandit6 -size 33c 2>/dev/null
/var/lib/dpkg/info/bandit7.password

都是ASCII文本,所以有什么区别

解决方法

path 参数告诉find搜索位置。如果使用.,它将仅在当前目录的子目录中搜索,而/表示根目录,即它将在所有位置搜索。而且,确实如您所见,/var/lib/dpkg/info/不是~/inhere的子目录。

,

如果您正在谈论linux find命令:

find . [other expressions]表示您要根据当前目录查找文件。

find / [other expressions]表示您要基于根(/)目录查找文件。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...