我正在尝试settings.xml
在我的Ubuntu计算机中查找文件。我不知道它在哪里,以及它在哪个目录中。
我尝试使用此-
ls -R | grep settings.xml
但是它并没有显示完整路径。我是否需要尝试其他命令才能获得完整路径?
对于快速搜索(但不是确定的):
locate -br '^settings.xml$'
来自man locate
:
locate reads one or more databases prepared by updatedb(8) and writes
file names matching at least one of the PATTERNs to standard output,
one per line.
-b, --basename
Match only the base name against the specified patterns. This
is the opposite of --wholename.
-r, --regexp REGEXP
Search for a basic regexp REGEXP. No PATTERNs are allowed if
this option is used, but this option can be specified multiple
times.
在^
和$
确保只有文件名为settings.xml
而不是文件名称中包含 settings.xml
将被打印出来。
您可能需要首次运行:(updatedb
如root
)来更新/构建的数据库locate
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句