Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I display only Permissions and file names using ls command and how to list all files in a directory including full path, owner, group and permissions for each file?

share|improve this question

migrated from stackoverflow.com Oct 18 '10 at 13:56

This question came from our site for professional and enthusiast programmers.

you can use GNU find command instead of ls unless you are doing homework

find /path -printf "%f: %p: %u: %g %m (%M) \n" 

check the man page of find more the meaning of those specifiers.

share|improve this answer

You should actually do it that way

find /path -printf "%f:%p:%u:%g:%m\n"

That way you get also the permissions and each file gets listed on one line.

share|improve this answer
ls | xargs stat --printf "$(pwd)/%n %U %G %A \n"
share|improve this answer
1  
This seems to me to be the most direct way to accomplish the result – Leo Simon Jun 27 at 17:11

You must log in to answer this question.