22

How can I make the ls command show a file's full path instead of just its filename? With all its options, there must be a way, right?

An̲̳̳drew
  • 1,333

4 Answers4

18

Here is one option for doing this.

ls -d $PWD/*
An̲̳̳drew
  • 1,333
15

This is another way for individual files:

readlink -e filename
9

I usually use the find command:

find /dir -type f -name "*"
jscott
  • 25,114
Satanicpuppy
  • 5,994
-3
ls -d "`pwd`"/*

that's what worked for me.
Use *.mp3 if you want to list just mp3 files, for example. I did this to make a playlist.
keep the "" if there's spaces in the outputs (the path to the files)

b13n1u
  • 979
Rnnfs
  • 1