LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-18-2006, 08:34 PM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
Disk Usage syntax please


I am trying to get some disk usage figures.

If I have structure like this

dir1/subdir1
dir2/subdir2

dir2/subdir1
dir2/subdir2
dir2/subdir3


Doing a du -h shows me all, files, subdirs, too much.
doing a du -skh shows me the total size for the whole parent dir but no breakdown of subdirs
doing a du -skhS shows me the dirs but the subdirs as well so still a bit too much.

I want to see the totals for the top dirs dir1 and dir2 only not broken down into subdirs as well.

Any way I can get this view?

Thanks,
 
Old 06-18-2006, 08:41 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I'm assuming that you mean the depth should stop at the contents of dir1 and dir2. Does the following do what you need?
Code:
du -sh dir1/* dir2/*
 
Old 06-18-2006, 09:13 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Try --max-depth=1
 
Old 06-18-2006, 11:25 PM   #4
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
the max depth does the trick thanks, the first solution is still showing everything in the specified dirs so not exactly what I was looking for.

Thx for your help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LQ disk usage student04 LQ Suggestions & Feedback 4 10-24-2004 09:35 PM
Disk Usage karan101 Linux - Software 8 10-17-2004 03:59 AM
Usage Syntax in Programs sovietpower Programming 1 09-07-2004 12:34 AM
AS 2.1 disk usage buck2bcr Red Hat 4 03-23-2004 09:50 AM
101% disk usage on an empty disk tsiuser Linux - Software 3 01-28-2004 06:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration