Basic Linux Command

How can I see the sizes of the linux directory with sub-directory. e.g "dir /s" in DOS
kennycpuAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jlevieConnect With a Mentor Commented:
do your mean the total amount of space a directory and its subdir's occupies? For that you'd use 'du -s /path-to/some-dir'. Check 'man du' for more options.

If you want to see all of the files in a dir and subdirs use:

ls -R /path-to/some-dir
 -or-
ls -lR /path-to/some-dir
0
 
ahoffmannCommented:
ls -lR|awk '/^-/{bytes+=$5}END{print bytes}'
0
 
pmonzCommented:
du -h <dirname>

where <dirname> is the name of the directory or . for the actual directory.
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.