我如何吐出一行递归路径的平面列表?

例如,我只想要一个文件的完整路径的平面列表:

/home/dreftymac/.
/home/dreftymac/foo.txt
/home/dreftymac/bar.txt
/home/dreftymac/stackoverflow
/home/dreftymac/stackoverflow/alpha.txt
/home/dreftymac/stackoverflow/bravo.txt
/home/dreftymac/stackoverflow/charlie.txt

ls -a1几乎满足了我的需要,但我不想要路径片段,我想要完整的路径。


当前回答

从当前位置的所有文件递归列表:

Ls -l $(查找。类型)

其他回答

我不知道完整的路径,但你可以用-R来递归。或者,如果您不倾向于ls,您可以只查找*。

Ls -ld $(找到。)

如果你想根据修改时间对输出进行排序:

Ls -ltd $(查找。)

du -a

方便一些有限的设备外壳的查找/定位不可用。

我知道文件名,但也想知道目录。

find $PWD | fgrep filename

在Mac OS 10.12.1中完美运行

找到/就行了