Search code examples
linuxunixpathlspwd

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


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)


Solution

  • You can use find:

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