Recursively list all files in a directory including files in symlink directories

后端 未结 8 941
甜味超标
甜味超标 2020-12-07 07:46

Suppose I have a directory /dir inside which there are 3 symlinks to other directories /dir/dir11, /dir/dir12, and /dir/dir13

8条回答
  •  无人及你
    2020-12-07 08:13

    The -L option to ls will accomplish what you want. It dereferences symbolic links.

    So your command would be:

    ls -LR
    

    You can also accomplish this with

    find -follow
    

    The -follow option directs find to follow symbolic links to directories.

    On Mac OS X use

    find -L
    

    as -follow has been deprecated.

提交回复
热议问题