LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-17-2012, 04:16 AM   #1
argess
LQ Newbie
 
Registered: Feb 2012
Posts: 1
Blog Entries: 1

Rep: Reputation: Disabled
commands to find size of root dir minus home...


i'm new to linux; wanted to find out how large root is without home directory (to see if it's too large to back up to cloud). from looking around it seems i'd do "sudo du ./ [but how to get a size summary excluding the home folder?]
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-17-2012, 04:40 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
How about getting the disk usage on / and on /home and doing the subtraction yourself?

You may prefer to use du with the -h and -s options.

If the backup compresses the data, the size reported by du will be more than the size of what you want to write to the cloud.
 
1 members found this post helpful.
Old 02-17-2012, 04:42 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Code:
cd /;  du -h --exclude="home/*"
This can be run either as user or as root.
 
3 members found this post helpful.
Old 02-17-2012, 04:51 AM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,614

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Quote:
i'm new to linux; wanted to find out how large root is without home directory (to see if it's too large to back up to cloud). from looking around it seems i'd do "sudo du ./ [but how to get a size summary excluding the home folder?]

If your / and /home directories are mounted separately you will get respective sizes in a single command:

Quote:
df -haT
But if / and /home are mounted on one and the same partition you will need to get /home total and deduct it from the total of /.

Quote:
df -h /
and for the home you will get it by

Quote:
du -cs /home
the total size here you deduct from the size of the root above df, what remains thus is the size of the rest of root directories /* less /home.

Hope that helps.

Last edited by malekmustaq; 02-17-2012 at 04:53 AM.
 
1 members found this post helpful.
  


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
Can't find .ssh dir in home dir bobby953 Linux - Newbie 5 03-09-2009 05:00 AM
my home dir dosnet let me in only root ): ): shakedt Linux - Newbie 3 12-20-2005 03:25 AM
find users home dir c++ Simon_6162 Programming 2 02-04-2005 08:53 PM
command to find size of a dir Longinus Linux - Newbie 3 08-01-2004 09:19 PM
RealPlayer_8, in home dir, runs only as root. RealNewbie Linux - General 2 08-17-2003 05:09 PM


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