bash 在linux中列出具有绝对路径递归的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3335431/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
List files with absolute path recursive in linux
提问by Stollan
This question is quite similar to How can I list files with their absolute path in linux?
这个问题与How can I list files with their absolute path in linux非常相似?
I want to get the name of file or folder with absolute path and date modified.
我想获取具有绝对路径和修改日期的文件或文件夹的名称。
This command almost does it:
这个命令几乎可以做到:
ls -lR /foo/bar | awk '{print ,,,}'
But it doesnt show the absolute path.
但它没有显示绝对路径。
Regards Stollan
问候斯托兰
回答by ghostdog74
Check out the find
command and its printf
option.
查看find
命令及其printf
选项。
find /foo/bar -printf "%p %A@"
See the man page of find
for more information.
有关find
更多信息,请参阅手册页。
回答by Dan Mantyla
I like to use:
我喜欢使用:
ls -d -1 $PWD/**
回答by brokengillou
After reading some partial solutions no recursion, partial date format, no pipe... my proposition is from the target folder:
在阅读了一些部分解决方案后,没有递归,部分日期格式,没有管道……我的提议来自目标文件夹:
find . -type f -exec ls -lAoUtTh {} \; | awk '{print "\t""\/""\/""\t""\t"}' | grep -E -i '.*\.fcp\b|.*\.omf\b'
Works well thanks to contributors but very slowly basicly me.
多亏了贡献者,效果很好,但基本上我的速度很慢。
Gilles
吉尔斯
OsX Darwin 10.8 bash
OSX 达尔文 10.8 bash