Get size of all files in a folder

I have a folder with thousands of sub-folders within it and lots of files.

Is there anyway I can run a command at the SSH level to list all the files out along with their sizes and the path to the file? Even better write the results to a text file.
PeterErhardAsked:
Who is Participating?
 
vikas_madhusudanaCommented:
du -s *

for more details check

http://en.wikipedia.org/wiki/Du_(Unix)
0
 
TintinCommented:
ls -lR /folder >/tmp/results.txt

or

find /folder -type f -ls >/tmp/results.txt




0
 
TintinCommented:
The accepted solution doesn't address your requirements.

1.  It doesn't list files in sub-folders.
2.  It will list files *and* directories
3.  It doesn't write the output to a file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.