我现在有:

ls -1 $(pwd)/*

给我带有绝对路径的目录中的所有文件 - 但是使用每个文件列表开头的目录对其进行格式化。

有没有办法只是递归地获取目录中的文件列表(绝对路径) - 不包括目录/子目录本身?

有帮助吗?

解决方案

find $(pwd) -type f -print

find $(pwd) -type f -ls

其他提示

如果要将其输入其他内容,则可能需要-print0(以处理带空格的文件名)。

例如:找到。 -type f -print0 | xargs --null --no-run-if-empty grep

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top