找到一个文件名,确保它存在并显示完整的详细信息

使用locate命令查找系统上的文件并验证它们是否存在(-e),然后全部显示每个文件。
.

0

linux命令:locate -e somefile | xargs ls -l -l ls xargs | somefile -e locate locate -e somefile | xargs ls -lrootopen.com
linux命令:locate -e somefile | xargs ls -l -l ls xargs | somefile -e locate locate -e somefile | xargs ls -lrootopen.com
wubd 2018-02-27 03:40:48
输出
linux命令:locate 详解

评论

相关推荐

locate命令用于按名称查找文件,locate实用程序比找到它更好,更快。 下面的命令将按其确切名称(而不是* name *)搜索文件

linux命令:locate -b'\ domain-list.txt' domain-list.txt' -b'\ locate locate -b'\ domain-list.txt'rootopen.com
linux命令:locate -b'\ domain-list.txt' domain-list.txt' -b'\ locate locate -b'\ domain-list.txt'rootopen.com
.

linux命令:locate file1 dir1 dir1 file1 locate locate file1 dir1rootopen.com
linux命令:locate file1 dir1 dir1 file1 locate locate file1 dir1rootopen.com
.

linux命令:locate searchstring | xargs ls -l -l ls xargs | searchstring locate locate searchstring | xargs ls -lrootopen.com
linux命令:locate searchstring | xargs ls -l -l ls xargs | searchstring locate locate searchstring | xargs ls -lrootopen.com
.

Greps找到表达式的文件。例如greps所有LaTeX文件的'foo':locate * .tex | xargs grep foo要避免使用grep搜索数以千计的文件,可能有用首先测试locate返回多少文件:locate -c * .tex

linux命令:locate searchstring | xargs grep foo foo grep xargs | searchstring locate locate searchstring | xargs grep foorootopen.com
linux命令:locate searchstring | xargs grep foo foo grep xargs | searchstring locate locate searchstring | xargs grep foorootopen.com
.

首先,你需要确保updatedb已经运行/ updatedb,并初始化db:su -l root -c updatedbThis locate命令是通过mlocate软件包提供的,默认情况下安装在大多数GNU / Linux发行版上。它也可以在BSD上使用。不确定支持专有UNIX系统。输出结果不言自明 - 它提供了系统中有多少目录和文件的概述。

linux命令:locate -S -S locate locate -Srootopen.com
linux命令:locate -S -S locate locate -Srootopen.com
.

linux命令:locate munin | xargs rm -r -r rm xargs | munin locate locate munin | xargs rm -rrootopen.com
linux命令:locate munin | xargs rm -r -r rm xargs | munin locate locate munin | xargs rm -rrootopen.com
.

转义路径中的空格。

linux命令:locate -i yourfilename | sed 's/ /\\ /g' | xargs ls -lah | less less | -lah ls xargs | /g' /\\ 's/ sed | yourfilename -i locate locate -i yourfilename | sed 's/ /\\ /g' | xargs ls -lah | lessrootopen.com
linux命令:locate -i yourfilename | sed 's/ /\\ /g' | xargs ls -lah | less less | -lah ls xargs | /g' /\\ 's/ sed | yourfilename -i locate locate -i yourfilename | sed 's/ /\\ /g' | xargs ls -lah | lessrootopen.com
.

通过关键字和基本正则表达式查看一些代码的另一种方法

linux命令:locate *\\.php|xargs grep --color=always -i -5 "namespace\s.*\W"|less "namespace\s.*\W"|less -5 -i --color=always grep *\\.php|xargs locate locate *\\.php|xargs grep --color=always -i -5 "namespace\s.*\W"|lessrootopen.com
linux命令:locate *\\.php|xargs grep --color=always -i -5 "namespace\s.*\W"|less "namespace\s.*\W"|less -5 -i --color=always grep *\\.php|xargs locate locate *\\.php|xargs grep --color=always -i -5 "namespace\s.*\W"|lessrootopen.com
.

找到我系统上的所有书籍,并将它们移动到文件夹中。 -0开关是处理文件名中的空格等。 为什么你需要这个? Locate使用索引,因此速度非常快, 而xargs比for循环更优雅。

linux命令:locate -0 -i *barthes* | xargs -0 mv -t ~/'Library/Books/Barthes, Roland' Roland' ~/'Library/Books/Barthes, -t mv -0 xargs | *barthes* -i -0 locate locate -0 -i *barthes* | xargs -0 mv -t ~/'Library/Books/Barthes, Roland'rootopen.com
linux命令:locate -0 -i *barthes* | xargs -0 mv -t ~/'Library/Books/Barthes, Roland' Roland' ~/'Library/Books/Barthes, -t mv -0 xargs | *barthes* -i -0 locate locate -0 -i *barthes* | xargs -0 mv -t ~/'Library/Books/Barthes, Roland'rootopen.com
.

使用“locate”代替“find”,“sort -u”代替“sort | uniq”,不区分大小写。

linux命令:locate -i /pattern/ | xargs -n1 dirname | sort -u -u sort | dirname -n1 xargs | /pattern/ -i locate locate -i /pattern/ | xargs -n1 dirname | sort -urootopen.com
linux命令:locate -i /pattern/ | xargs -n1 dirname | sort -u -u sort | dirname -n1 xargs | /pattern/ -i locate locate -i /pattern/ | xargs -n1 dirname | sort -urootopen.com
.
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令