ygemici
February 25, 2010, 10:50am
1
Hi
I want to find files with size +10000M and specified directorys except
when i use more than one `-name` acton is fail
I try -a (and) and -o (-or) but results fail
find . \( -name ./oracle* -prune -o -name "*arc*" -prune -o -name "*oracle*" -prune -o -size +10000k \) -exec ls -lh {} \; | more
but it command only except `oracle` directory and others (-name ) isn't consider..But i want to except oracle* + data* + arc* same time in my search..
methyl
February 25, 2010, 8:31pm
3
Not clear what you are trying to achieve.
Which directories do you want to search for big files? (Full pathname please).
Or.
Which directories do you not want to search for big files? (Full pathname please).
Maybe by "expect" you actually mean "except". Please check the wording of your post with someone with good English.
ygemici
February 26, 2010, 2:43am
4
All disks already mount root filesystem.So when i search files , all disks scan in my search.But i want to search only root file system.( so /dev/sda1)
mpics66
February 26, 2010, 3:08am
5
I am not sure of your request , but if the requirement is to only search for files under / & not any other mounted FS on / then
find / -mount -name filename ( please check syntax, mount skips files on other FS)
should do the job.
Post if it works
methyl
February 26, 2010, 5:23am
6
Further to mpics66 . In many editions of "find" the "-mount" parameter is now called "-xdev. It confines the search to the one filesystem.
ygemici
February 26, 2010, 10:58am
7
thanks a lot..
-mount is usefull
I already successfull from other way
# find -path './oracle' -prune -o -path './log_TAHSILAT' -prune -o -path './log2_TAHSILAT' -prune -o -path './data_TAHSILAT' -prune
-o -path './data2_TAHSILAT' -prune -o -path './arc_TAHSILAT' -prune -o -path './arc2_TAHSILAT' -prune -o -path './quorum' -prune
-o -path './log_ESKI' -prune -o -path './log2_ESKI' -prune -o -path './data_ESKI' -prune -o -path './data2_ESKI' -prune -o -path './data3_ESKI' -prune
-o -path './data4_ESKI' -prune -o -path './data5_ESKI' -prune -o -path './data6_ESKI' -prune -o -path './data7_ESKI' -prune -o -path './data8_ESKI' -prune
-o -path './arc_ESKI' -prune -o -path './arc2_ESKI' -prune -o -path './arc_ESKI_ESKI' -prune -o -size +10000k -exec ls -lh {} \;
rdcwayx
February 28, 2010, 10:22pm
8
If you search several folders, your command will be good enough, but in this particular case, why not set the folder list file first?
$ cat list
oracle
log_TAHSILAT
....
....
The command can be shorted as below:
for folder in `cat list`
do
find $folder -size +10000k -exec ls -lh {} \;
done