I am looking for a command that lists all files in the current directory.


  1. Absolute paths
  2. One file per line
  3. No other information (like size, permissions...)
  4. Don't show folders

What I got so far is this:

ls -d1 $PWD/*

Which gives:

[User@User-arch Pictures]$ ls -d1 $PWD/*

or readlink -f $PWD/*, which gives the same output.

They satisfie all but the 4. requirements. How can I tweak it so it does not show folders? Or is there a simpler command?

2 Answers 2

find $PWD -maxdepth 1 -type f

Lists files in current working directory. -type f tells find list only regular files (no folders), -maxdepth 1 prevents content in subfolders showing up in output.


You could tell ls to include the trailing forward slash after directory names then pipe it to grep.

ls -pd1 $PWD/* | grep -v /$

Edit: Saw my flaw in original answer.

  • That doesnt show anything for me
    – Johannes
    Aug 2, 2017 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.