Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 31 Aug 2014, 04:17
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to make 'find' not search the Windows partition?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
dbd400@gmail.com

Joined: 26 May 2010
Posts: 31
Location: Silver Spring. MD 20901

PostPosted: Mon 22 Apr 2013, 09:16    Post_subject:  How to make 'find' not search the Windows partition?
Sub_title: Solved
 

I am running slacko5.5 installed as a full install. My Windows partition is /mnt/sda3. I was trying to tailor a 'find' to search only the linux part of the file space. I know I can do that by unmounting sda3, but that is inconvenient very often. In constructing the 'find' it seemed to me that either one of 2 expressions ought to do the job: ' ... ! -name "/mnt/sda3* ..." or '... path "/mnt/sda3" -prune", but the one with -prune ought to run a whole lot faster. The full command line would look something like:
a. find / \( -name "xxx...xxx" -a ! -name "/mnt*" \) ..., or
b. find / \( -name "xxx...xxx" -a -prune "/mnt*" \) ... or
c. find / \( -path "/mnt*" -prune -a -name "xxx...xxx" \) ... or
d. find / \( -name "/mnt*" -a -name "xxx...xxx" \) or
e. find / \( ! -name "/mnt*" -o -name "xxx...xxx" \) or
f. find / -path "/mnt" -prune -o -name "xxx...xxx' ...

The results are:
a, b, c, d all include many files starting "/mnt...".
e did not try
f works properly

It seems to mean that, in general, one must know enough about the expression to be searched upon to know where in the path it occurs. Its as if one gets only one crack at the path of each file, despite the syntax, so one must sort ones expressions. If you have 2 search strings, A and B, both of which must be present, but in any sequence, you mist try them as '-name a -a -name B' and also as '-name B -a -name A' to make sure you haven't got past either one, which ,makes no sense. Yes, you could shorten it to '\( -name "*A*B" -o -name "*B*A" \)'. Does this make sense? I believe that expectation is flawed. What does anyone else think?
Back to top
View user's profile Send_private_message 
tallboy


Joined: 21 Sep 2010
Posts: 442
Location: Oslo, Norway

PostPosted: Mon 22 Apr 2013, 14:15    Post_subject:  

From the find manual: (man find; query = filesystems)

-xautofs
Don't descend directories on autofs filesystems.

-xdev Don't descend directories on other filesystems.

-fstype type
File is on a filesystem of type type. The valid filesystem
types vary among different versions of Unix; an incomplete list
of filesystem types that are accepted on some version of Unix or
another is: ufs, 4.2, 4.3, nfs, tmp, mfs, S51K, S52K. You can
use -printf with the %F directive to see the types of your
filesystems.

-mount Don't descend directories on other filesystems. An alternate
name for -xdev, for compatibility with some other versions of find.

I hope you make it work.

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3261
Location: Ontario

PostPosted: Mon 22 Apr 2013, 14:31    Post_subject:  

Bulldog Finder allows a search just in one mounted partition.
This can be useful occasionally.

I put it in my right clicks package which is a must for Slacko users.


_____________________________________
Back to top
View user's profile Send_private_message 
dbd400@gmail.com

Joined: 26 May 2010
Posts: 31
Location: Silver Spring. MD 20901

PostPosted: Mon 22 Apr 2013, 19:55    Post_subject:  

Thanks, Tallboy. Although -xautofs failed in not getting any results, using -xdev gave perfect results on Slacko 5.5, full install, is easier to type, and needs no thinking, as mine does. (Of course, if one abandons all thinking, one deserves unthinkable results.) Thanks again!
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0530s ][ Queries: 12 (0.0043s) ][ GZIP on ]