Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Basic Linux Command

Posted on 2002-04-15
3
Medium Priority
?
201 Views
Last Modified: 2012-05-04
How can I see the sizes of the linux directory with sub-directory. e.g "dir /s" in DOS
0
Comment
Question by:kennycpu
3 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 120 total points
ID: 6943914
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6943965
ls -lR|awk '/^-/{bytes+=$5}END{print bytes}'
0
 

Expert Comment

by:pmonz
ID: 6947319
du -h <dirname>

where <dirname> is the name of the directory or . for the actual directory.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question