[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

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.
0
PeterErhard
Asked:
PeterErhard
  • 2
1 Solution
 
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

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now