I want to list all the files in a folder and their respective absolute paths line by line as below,
I tried with find $(pwd) -type f, but it only gives the paths.
find $(pwd) -type f
Using GNU find:
find "$PWD" -type f -printf '%f %h/%f\n'
Use this cmd:
find $PWD -type f -printf '%f %h/%f/n'
Looking for some files then go with this:
find $PWD -type f -iname "filenames" -printf '%f %h/%f/n'
You can use the following cmd for searching the files with their absolute paths.
E.g. I am trying to search .sh files using cmd as follows:
find . -type f -iname "*.sh"