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 01-23-2010, 02:02 AM   #1
buee
Member
 
Registered: May 2009
Posts: 81

Rep: Reputation: 16
Find and move files greater than 15GB


I have a Ubuntu NAS set up with two 1.5TB in a mirrored array. We recently needed more storage and will constantly be adding to this machine. We added 2 2TB drives in a striped array. What I'd like to do is find all directories totaling 10GB+ on the mirrored array and move them over to the striped array to increase storage on the mirrored array for smaller, more important data. I've tried:

Code:
find /mirror -maxdepth 1 -size 10G
find /mirror -size 10
find /mirror -size +10G
find /mirror -size +10G -maxdepth 1
find /mirror -size +10G -type d
As you can see, I haven't even gotten to the point of moving them over, but all of these produce 0 results and I know for a fact that there's at least 5 directories of 10GB or greater in /mirror. It doesn't appear to be calculating the size recursively. Does anyone know how I would go about accomplishing my task, or at least finding directories of =>10GB from bash?
 
Old 01-23-2010, 02:23 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

I think if your looking for the biggest directories that you'll be better of using du to list them. Something like this will give you all the directories in the one where you executed the command, only 1 level deep and list the size as Gb, then sort then numerical and recursive so that the biggest get listed first.
Code:
du -h --max-depth=1 -B G | sort -n -r
Kind regards,

Eric
 
Old 01-24-2010, 07:01 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Agree with Eric; the find cmd option -size is for file sizes, not dirs.
http://linux.die.net/man/1/find
Quote:
-size n[cwbkMG]
File uses n units of space. The following suffixes can be used:
 
  


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
find port greater than 6000 gsiva Linux - Server 1 09-03-2009 01:33 AM
Find files by their contents than move them in 1 command Setya Linux - Newbie 4 11-20-2008 10:09 AM
Script to find all picture files on a HDD and move them scoops98 Linux - General 8 02-27-2007 03:40 AM
find and move most recent files in dir backnine_99 Linux - Software 2 06-14-2005 01:03 PM
Can't find graphics card because greater than 64 PCI busses... how to fix? nirajpatel Linux - Hardware 1 07-26-2004 10:43 AM

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

All times are GMT -5. The time now is 03:59 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