"find" on different OS's


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users "find" on different OS's
# 1  
Old 12-14-2010
"find" on different OS's

Hi,

Long time user of RHEL, new to other OS's. Doing some searches on many different servers. I am working with RHEL, AIX, HP-UX, and Solaris. Really not happy with any of them using the find command. I am doing simple find commands like:
Code:
find / -group 1234
find / -user PEBKAC

RHEL 4 - Fastest, like by a long shot, but always seems to pull up something like this:
Code:
find: /proc/11845/task/11845/fd/4: No such file or directory

Is there a way to filter out these within the find command itself?

Sun/Solaris 5.1 - Slower than RHEL... same issue

AIX 5.3 and 6.1 - fairly clean, but slow.

HP- UX 11- So slow, I need to get up and walk around while it searches. I end up throwing up multiple sessions/servers, while waiting, and then lose track of what I am doing.

So, either find just sucks, or I am doing it wrong. More so on the supposedly "better" OS's and hopefully someone can point out a superior method. I am used to running RHEL, and always just dealt with the garbage, but the slowness of these other OS's are just a killer! Especially AIX...

Thoughts?

Last edited by Scott; 12-14-2010 at 05:52 PM.. Reason: Added some code tags
# 2  
Old 12-14-2010
Quote:
Originally Posted by tabini
find: /proc/11845/task/11845/fd/4: No such file or directory
Is there a way to filter out these within the find command itself?
Here is one way:
Code:
find / -group 1234 2>/dev/null

Quote:
Sun/Solaris 5.1 - Slower than RHEL... same issue
Hey, it's time to upgrade !
SunOS 5.1 was released in 1992 ... Smilie
This User Gave Thanks to jlliagre For This Post:
# 3  
Old 12-14-2010
/proc is a special filesystem that is very transitionary as it mirrors the state of the O/S, and has no "real" files, so I would recommend not running the find against it...You can remove it from the list by using something like:
Code:
find / -name proc -prune -o -group 1234 -print

The speed of the find is linked to the speed of the filesystem, the speed of the hardware it is running on, the tuning of the O/S (filesystem and inode cache sizes, etc), and the other work the server is doing.
I would recommend installing the GNU "findutils" and use "locate" if you are doing this on a regular basis.
This User Gave Thanks to citaylor For This Post:
# 4  
Old 12-14-2010
Quote:
Originally Posted by jlliagre
Hey, it's time to upgrade !
SunOS 5.1 was released in 1992 ... Smilie
The same year as AIX 1.3!

Is someone somewhere holding an antique hardware sale? Smilie
# 5  
Old 12-15-2010
The performance of the "find" program itself is pretty consistent across various editions of unix.
The Linux "locate" command is quick because it maintains a file index (similar to the Windows Search option) but maintaining this index itself becomes an issue on fast-changing systems.

Back to "find".

Given knowledge of the contents and structure of the filesystems it is a last resort to issue a "find" from root. Even then you need the "-follow" (links) switch to force "find" to search everywhere - thought this can cause "find" to report the same file more than once where there are linked directories.

On a mature O/S you could find yourself trawling through hundreds of thousands of irrelevant files and directories (like patch repositories etc.) or even files on other computers when NFS is involved.

Take note of the "-xdev" parameter to "find" (sometimes called "-mount" on old versions) which confines your "find" to a single filesystem.

Look at the inode count from "df -i" (or "bdf -i") to see how maby inodes are in use on each filesystem. This could explain some speed differences which cannot be accounted for by hardware differences or filesystem type.


Say if you are only interested in files in say "/home" issue "find /home -xdev " not "find /" .

Last edited by methyl; 12-15-2010 at 08:28 AM.. Reason: typos
# 6  
Old 12-15-2010
I respectfully think the statement:
Quote:
Originally Posted by methyl
The performance of the "find" program itself is pretty consistent across various editions of unix.
Is a little misleading and needs some qualification.
Although the find program generally works in a similar way across most UNIX/Linux variants, the performance of it is wildly different depending upon lots of factors (filesystem type/performance, filesystem tuning, hardware, O/S tuning etc). Solaris for example is notoriously slow on its UFS performance.
I will qualify this qualification with some statistics:
My solaris 8 box running IDE drives is currently doing around 4940 files per second on a given find.
My solaris 10 box running striped SCSI U320 drives is currently doing around 4854 files per second.
My AIX 5.3 43p-170 box with U160 drives on JFS is getting 4766 files per second.
My HP-UX 11.11 C3600 with U160 drives on VXFS is getting 5220 files per second.
My HP-UX 11.23 Integrity box with U320 drives on VFXS 8461 files per second.
My OpenSuSE 11.2 Lenovo W500 laptop running a SATA II drive @ 7200RPM on an EXT4 filesystem is getting 13736.
As you can see - wildly different results on wildly different platforms, with my laptop being the fastest!
This is why performance tuning and benchmarking can be one of the most complex areas of computing, due to the multitude of factors involved.

I hope this helps....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find files in sub dir with tag & add "." at the beginning [tag -f "Note" . | xargs -0 {} mv {} .{}]

I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies

4. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

5. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

6. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

7. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

8. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

9. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

10. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
Login or Register to Ask a Question