![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find cmd working in Linux and not in SunSolaris 5.8 | navjotbaweja | SUN Solaris | 4 | 11-28-2007 11:21 AM |
| To find the RAM size for an Linux server. | navojit dutta | Shell Programming and Scripting | 3 | 09-14-2007 04:49 AM |
| Where can I find Linux functions corresponding to the Solaris DDI? | boyanov | High Level Programming | 3 | 06-28-2007 06:31 AM |
| How to find the help in Linux | zp523444 | UNIX for Dummies Questions & Answers | 3 | 12-13-2005 04:02 PM |
| Command to find 32/64 bit in Linux | giribt | UNIX for Dummies Questions & Answers | 3 | 08-17-2005 06:19 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Find in HP,AIX vs Linux
Hi Guys,
Wondering if anyone can help me. I have a find command on a Linux box that works as expected: Code:
find \( -not -type d -or -not -name log -and -not -name loc -and -not -name usr -and -not -name etc -and -not -name tmp -and -not -name wrk -and -not -name changes -or -prune \) -and -not -type d -exec ls -1 {} \;
Problem is I can't get the syntax correct for HP and AIX. It seems I cannot use -not or -or. Any suggestions would be helpful, Cheers Last edited by Yogesh Sawant; 06-23-2008 at 12:54 AM. Reason: added code tags |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
GNU find has a number of extensions which are not commonly found on traditional big-iron systems. Usually, you can install GNU find on those systems (or find, to your surprise, that somebody already did, and you just needed to find it. Sorry for the bad puns). If that's not an option, perhaps the Perl find2perl utility can help you achieve what you want.
|
|
#3
|
|||
|
|||
|
Yup - for AIX there you go:
IBM AIX Toolbox Download Page - Alphabetical Listing Check for "findutils". |
|
#4
|
|||
|
|||
|
Thanks for the speedy response guys,
Maybe what I am trying to do needs a little more explaination. I am executing the command remotly through ssh -qT on over 200 servers so installing GNU is not an option. What I really need is examples of any find command using -prune, -not and -or (or eqivalent) on HP and AIX so I can create the commands. Cheers |
|
#5
|
|||
|
|||
|
How do you manage so many hosts? How do you handle updates? Don't you use a CSM for AIX? Else -> "man find" and good luck
|
|
#6
|
|||
|
|||
|
If you are creating scripts/commands for so many different hosts you should not develop them on a Linux box. The reason is that GNU utilities have so many extra-features that getting the command to work on other UNIX dialects is usually impossible.
The "logical not" in standard "find" is the exclamation mark: Code:
find . ! -type d I hope this helps. bakunin |
|
#7
|
|||
|
|||
|
Hi All,
Got it working in the end: Code:
find . \( ! -type d -o ! -name log -a ! -name loc -a ! -name usr -a ! -name etc -a ! -name gridctrl -a ! -name tmp -a ! -name wrk -a ! -name changes -o -prune \) -a ! -type d -exec ls -1 {} \;
Last edited by Yogesh Sawant; 06-23-2008 at 12:56 AM. Reason: added code tags |
|||
| Google The UNIX and Linux Forums |