• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • 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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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