开发者

List all files in a directory with abosolute paths (excluding directories)

I've currently got:

ls -1 $(pwd)/*

Gives me all the files in a directory with absolute paths - but formats it with the directory at the start of each li开发者_运维技巧st of files.

Is there a way just to get a list of files in a directory recursively (absolute paths) - excluding the directory/sub-directories themselves?


find $(pwd) -type f -print

or

find $(pwd) -type f -ls


If you are feeding it into something else, you might want -print0 (to handle filenames with spaces).

E.g.: find . -type f -print0 | xargs --null --no-run-if-empty grep

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜