LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 02: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, 02:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,999

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
Try "man du"
 
Old 11-12-2008, 03: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, 10: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:58 PM
samba, add dir, but dirs that's there are ro jo4 Linux - Server 1 01-17-2008 04:19 PM
command to show only dirs in current dir? Lordandmaker Linux - Newbie 3 01-06-2006 08:11 AM
Bash script to process every file in current dir and sub dirs BuckRogers01 Linux - Software 3 09-06-2005 08:32 AM
Cmd to rm dir thats has files and other dirs psyklops Linux - General 4 04-17-2002 09:12 PM

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

All times are GMT -5. The time now is 07:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration