Using
ls -R /
,
i get every file and directory listed that exists, but not with the full file path.
What do I need to write on the command line in order to get a list in such a format, that every line contains an absolute path.
You can get the files with full path with this command:
find / -type f
or list files from the current directory down:
find $(pwd) -type f
find $(pwd)
, I get list of folders and files with absolute path under current directory, I just want the paths of files and ignore the folder paths, is there a way to do it?
-type f
to the above command. thanks
There are two commands you can use along with ls
if you intend just for the files in a particular directory.
I can't show you realpath
output as i don't have it in my system.
You can make readlink
to do that for you.
ls | xargs -n 1 readlink -f
WARNING: you may not get the abs path for the soft links as that will be converted to the files which are the linked to.
find