• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Basic Linux Command

How can I see the sizes of the linux directory with sub-directory. e.g "dir /s" in DOS
0
kennycpu
Asked:
kennycpu
1 Solution
 
jlevieCommented:
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.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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