LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Find and move files greater than 15GB (https://www.linuxquestions.org/questions/linux-newbie-8/find-and-move-files-greater-than-15gb-784155/)

buee 01-23-2010 01:02 AM

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?

EricTRA 01-23-2010 01:23 AM

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

chrism01 01-24-2010 06:01 PM

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:


All times are GMT -5. The time now is 05:50 AM.