LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-08-2003, 08:00 AM   #1
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Rep: Reputation: 30
Help using a specific "Find" query


Hi. I'm currently having a bit of fun with the find parameter. Amazing how versatile it is! Anyway, what I'm trying to do is:

look for everything that the user jryan owns BUT ignore the /dev and /proc branches

find / -user jryan # simple straight forward search test first... OK

But when I try:

find / -user jryan -prune /dev /proc or find / -prune /dev /proc -user jryan

I get: > paths must precede expression

man find suggest -path but I still get the same message. Can anyone spot where I'm going wrong?
 
Old 04-08-2003, 09:35 AM   #2
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
That's a tough one... Try this instead:

(from /)

find `ls | grep -v 'proc\|dev'` -user jryan
 
Old 04-08-2003, 11:12 AM   #3
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Code:
find / -path './dev' -prune -path './proc' -prune -o -user jryan -print

Last edited by moses; 04-08-2003 at 11:15 AM.
 
Old 04-08-2003, 12:56 PM   #4
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Original Poster
Rep: Reputation: 30
moses and bentz,

Thanks for your very quick replies. I got closest with:

find / -path './dev' -prune -path './proc' -prune -o -user jryan -print


but /dev still shows up in the output. ./dev means current dir and beyond.. wonder what could be throwing it off ?
 
Old 04-08-2003, 05:49 PM   #5
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Sorry, you need to have a -o after the first -prune.
 
Old 04-08-2003, 06:11 PM   #6
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Original Poster
Rep: Reputation: 30
Talking

Argh! Of course! Appreciate your help Moses!
 
Old 04-09-2003, 10:43 AM   #7
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
find / -path './dev' -prune -or -path './proc' -prune -or -user jryan -print

That's facinating, I've never used the expressions that extensively. So it's doing:

find / (if) -path './dev' (then) -prune -or (if) -path './proc' (then) -prune -or (if) -user jryan (then) -print

You da man, Moses!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
Several "find -exec" and "find | xargs" questions thanhvn Programming 4 12-02-2005 01:04 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Where can I find the "make" & "cc" packages?? sayeed_ather Mandriva 2 04-28-2004 02:02 AM
"host" ok, but "ping" can't find ip address hardigunawan Linux - Networking 2 05-16-2002 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:37 PM.

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