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

后端 未结 21 2250
天涯浪人
天涯浪人 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:45

    Here's an example that prints out a list without an extra period and that also demonstrates how to search for a file match. Hope this helps:

    find . -type f -name "extr*" -exec echo `pwd`/{} \; | sed "s|\./||"
    

提交回复
热议问题