How can I generate a list of files with their absolute path in Linux?

后端 未结 21 2233
天涯浪人
天涯浪人 2020-11-28 16:56

I am writing a shell script that takes file paths as input.

For this reason, I need to generate recursive file listings with full paths. For example, the file

21条回答
  •  孤独总比滥情好
    2020-11-28 17:39

    fd

    Using fd (alternative to find), use the following syntax:

    fd . foo -a
    

    Where . is the search pattern and foo is the root directory.

    E.g. to list all files in etc recursively, run: fd . /etc -a.

    -a, --absolute-path Show absolute instead of relative paths

提交回复
热议问题