LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-12-2008, 01:18 AM   #1
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Rep: Reputation: 16
Size occupied by a dir (with sub-dirs)


Hello,

I want to move a whole directory (incl its sub-dirs) to a new partition.
Before starting to do so I want to know what the size is this dir occupies on my actual partition. (to be sure that the new partition is great enough).

How can I know what the actual size is ?
My dir to move is /home/me/data/*

Thanks
 
Old 11-12-2008, 01:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Try "man du"
 
Old 11-12-2008, 02:31 AM   #3
anonobomber
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: Debian, Fedora, CentOS, FreeBSD, OpenSolaris
Posts: 138

Rep: Reputation: 16
And if the man page confuses you then you can run 'du -sh'. Another one that is helpful is 'du --max-depth=1 .' which will tell you the size of the contents of each directory. To go one step further you can sort these by the size of the contents by running 'du --max-depth=1 . | sort -n' which makes finding which folder is using the most space easy.
 
Old 11-15-2008, 09:03 AM   #4
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Original Poster
Rep: Reputation: 16
Thanks to all.
I got the information I needed.

ps : doe someone know how I can get the information of the size used in sectors ? (ranish Partition manager works with sectors. It would be easy to have the size used by the dir in sectors)
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy svn working dir without svn hidden dirs and files? erinspice Linux - Software 4 03-29-2011 05:58 PM
samba, add dir, but dirs that's there are ro jo4 Linux - Server 1 01-17-2008 03:19 PM
command to show only dirs in current dir? Lordandmaker Linux - Newbie 3 01-06-2006 07:11 AM
Bash script to process every file in current dir and sub dirs BuckRogers01 Linux - Software 3 09-06-2005 07:32 AM
Cmd to rm dir thats has files and other dirs psyklops Linux - General 4 04-17-2002 08:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:59 PM.

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