LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-28-2008, 12:45 PM   #1
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Rep: Reputation: 17
Solaris + find -prune command puzzle


Hi,

I would like to find a file named ups_data on the / filesystem but not search in /tmp and /var and not to search on nfs and autofs file system's.

I think that with Solaris you have to use -prune and not ! but I could be wrong. I think the Solaris find functionality is slightly different to Linux's.

For some reason this is'nt working, but I can't seem to progress.

$ find / -fstype nfs -prune -o -fstype autofs -prune -o -type d -name "/tmp" -prune -o -name "ups_data" -print 2>/dev/null


Thank you
 
Old 02-28-2008, 06:29 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I would use something like this:
Code:
$ find / \( -fstype nfs -o -fstype autofs -o -name tmp \) -prune -o -name "ups_data" -print
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
locate command - puzzle Mr T Donegal Linux - General 2 02-04-2008 10:18 AM
Use the prune option in find command frznchckn Linux - General 1 06-06-2007 07:18 PM
How to prune more than one directory using GNU find judgex Programming 1 06-03-2006 11:50 PM
A bash puzzle: queue up command for root to run? rose_bud4201 Programming 14 11-21-2005 04:14 PM
wvdial puzzle..... Can't find phone number! Adrian Baker Linux - Newbie 20 05-09-2004 11:18 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration