and how to list all files in a directory including full path, owner, group and permissions for each file

link|improve this question
feedback

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

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

3 Answers

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback
ls | xargs stat --printf "$(pwd)/%n %U %G %A \n"
link|improve this answer
feedback

Your Answer

 
or
required, but never shown