using 'ls' with options and folder and get full path

user3473590 picture user3473590 · Mar 15, 2015 · Viewed 8.4k times · Source

i'm using ls myfolder

and I've seen ls -lrt -d -1 $PWD/* which lists files with full path

the question is how do i list files with full path in a folder? (without using cd to go inside that folder)

Answer

hek2mgl picture hek2mgl · Mar 15, 2015

You can use find:

find PATH_TO_FOLDER -maxdepth 1 -type f -printf "%p\n"