繁体   English   中英

Bash 将文件列为 {path + file}

[英]Bash list files as {path + file}

我想搜索一个大小为 1033 字节的文件。 因此,我编写ls -lRA ,它在大约 20 个文件夹中输出大约 200 个文件。 当我用ls -lRA | grep 1033为文件 grep ls -lRA | grep 1033我只得到一个元素, -rw-r----- 1 root bandit5 1033 Dec 3 08:14.file2 但是,有 20 个文件同名,所以找到这个文件是一项艰巨的任务。

我的想法是得到一个 output 例如-rw-r----- 1 root bandit5 1033 Dec 3 08:14./direcctory1/.file2 ,这可能吗?

我建议使用 GNU find。 从当前目录搜索:

find . -size 1033c -ls

Output(例如)

110578      3 -rwxrwxrwx   1 root     root         1033 Dec  6 10:10 ./direcctory1/.file2

参见: man find

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM