Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

3 Answers 3

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.