Find in HP,AIX vs Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find in HP,AIX vs Linux
# 1  
Old 06-18-2008
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 {} \;

Selects all files that are not in speified directories.

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 04:54 AM.. Reason: added code tags
# 2  
Old 06-19-2008
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  
Old 06-19-2008
Yup - for AIX there you go:
IBM AIX Toolbox Download Page - Alphabetical Listing
Check for "findutils".
# 4  
Old 06-19-2008
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  
Old 06-20-2008
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 Smilie The rpm of gnu find should be very small so no much impact on network and boxes either.
# 6  
Old 06-20-2008
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

will find everything except for directories, for instance. The GNU find should understand this too.

I hope this helps.

bakunin
# 7  
Old 06-22-2008
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 {} \;

Thanks for all the help!!!

Last edited by Yogesh Sawant; 06-23-2008 at 04:56 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

AIX find with Variables

I am trying to do a find with a variable but no matter which way I try it does not work. This is aix. Can I get some ideas on what I am doing wrong? for i in `cat file`; do find / -type f -name "$i" -exec ls -l {} + ; done for i in `cat file`; do find / -type f -name "\$i" -exec ls -l... (6 Replies)
Discussion started by: cokedude
6 Replies

2. AIX

AIX - find command with mtime

Hello experts, I would get from a list of files, which are more ancient than 1 hour. Examples: Current date: Wed Oct 28 16:10:02 SAT 2015 using: find path -name 'file_name. *' -mtime +0 I see files with less at 00:00:00 date of the current day. /path/file_name.20151027170725... (7 Replies)
Discussion started by: carlino70
7 Replies

3. Shell Programming and Scripting

Find command not working on AIX

Hello, I am running find command in an AIX Server to find last 7 days modified directories/files. >cd /usr/openv/netbackup/db/class >ls -l total 0 drwxr-xr-x 3 root system 256 May 28 2014 Catalog-Backup drwxr-xr-x 3 root system 256 Sep 18 2012 ... (4 Replies)
Discussion started by: rahul2662
4 Replies

4. AIX

How to find AIX Free Memory?

All, AIX: 6.1 64 bits How to find out Free memory available on AIX 6.1 64 bits When I used : svmon -G size inuse free pin virtual mmode memory 1048576 612109 191151 215969 549824 Ded-E pg space 4325376 ... (1 Reply)
Discussion started by: a1_win
1 Replies

5. AIX

How to find if AIX supports GUI

Hi Everyone I'm preparing for upgrading an application. The application upgrade documents say the following. its AIX 5.3 Server. How do I find if my AIX supports the X11 windowing environment? Thanks. (1 Reply)
Discussion started by: rocker_me2002
1 Replies

6. UNIX for Dummies Questions & Answers

find command AIX

Hi all , could anyone please help with find command in AIX. I am trying to find files but there are more than 30thousand files in there.I realise I need to use xargs somehow but dunno the correct way to pull this. find /log_directory/* -prune -xdev -type f -mtime +20 | xargs ls -l the... (2 Replies)
Discussion started by: erinlomo
2 Replies

7. AIX

Where to find printer drivers for AIX 5.x

I was wondering if somebody knew of a website where printer drivers can be downloaded for AIX 5.3. Most of our printers are HP and the driver that is installed works properly. As of lately, our users have started to get other type of printers, including Multi-purpose devices. I am struggling to... (2 Replies)
Discussion started by: fabiogilr
2 Replies

8. AIX

how to find virtual ip in aix.

hi, can some body in helping me in finding the virtual ip of the aix machine using ifconfig. I tried ifconfig -a but there could be any interface name so finding that out would be difficult. So colud anyone suggest me some option. thanks (2 Replies)
Discussion started by: prasi_in
2 Replies

9. UNIX for Dummies Questions & Answers

How to find out the spec of my AIX?

Does anyone know if there are any commands that allow me to find out the spec of my AIX machine? It's RS6000. Thx (2 Replies)
Discussion started by: E-Quality
2 Replies
Login or Register to Ask a Question