Find skipping NFS directories

Find skipping NFS directories

Post by SQ » Thu, 23 Mar 2006 05:37:21



Does the following find command skip NFS and CDFS partitions or look in
them?

find / ! \( -fstype nfs \) ! \( -fstype cdfs \)

 
 
 

Find skipping NFS directories

Post by Robert Bono » Thu, 23 Mar 2006 09:07:54




>Does the following find command skip NFS and CDFS partitions or look in
>them?

>find / ! \( -fstype nfs \) ! \( -fstype cdfs \)

A 'cdfs' filesystem *fails* the first test
A 'nfs' filesystem *fails* the second test.

Try:
    find / ! \( -fstype nfs -o -fstype cdfs \)

 
 
 

Find skipping NFS directories

Post by SQ » Thu, 23 Mar 2006 23:37:30


I am trying the following but it doesn't find the files I want, it's
missing a lot. Why is that?

find / \( -fstype nfs -o -fstype cdfs -o -path /dir1 -o -path /dir2  \)
-prune

 
 
 

Find skipping NFS directories

Post by Stephane Chazela » Thu, 23 Mar 2006 23:53:42



Quote:> I am trying the following but it doesn't find the files I want, it's
> missing a lot. Why is that?

> find / \( -fstype nfs -o -fstype cdfs -o -path /dir1 -o -path /dir2  \)
> -prune

[...]

find / \( -fstype nfs -o -fstype cdfs \) -prune -o \
  \( -path /dir1 -o -path /dir2 \) -print

But, then you should do it:

find /dir1 /dir2 \( -fstype nfs -o -fstype cdfs \) -prune -o -print

--
Stephane

 
 
 

Find skipping NFS directories

Post by SQ » Fri, 24 Mar 2006 00:57:02


No, I want to exclude /dir1 and /dir2 as well as NFS and CDFS type
directories.

In my post above, the find command does not accomplish this, it
excludes too much and I only get a few lines where as it should be
finding a lot more.

The following seems to work.  If so, that last "-o" is what made it
work.

find / \( -fstype nfs -o -fstype cdfs -o -name /dir1 -o -name dir2 \)
-prune -o -print

 
 
 

Find skipping NFS directories

Post by SQ » Fri, 24 Mar 2006 01:04:08


Whoops, no. In response to the find command I just posted,   the
command does *not* exclude /dir1 and /dir2.
How can I make it exclude these directories?
 
 
 

Find skipping NFS directories

Post by Robert Bono » Fri, 24 Mar 2006 06:40:30




>Whoops, no. In response to the find command I just posted,   the
>command does *not* exclude /dir1 and /dir2.
>How can I make it exclude these directories?

Are you missing a 'not' operator?
 
 
 

1. find - how to skip directories?

I would like to know how to confine
find's operation to the specified
directory, that is, prevent it from
descending into subdirectories.

For example, this command:

produces this output:

/bin/dotl
/misc/class/data
/dirs
/dxxx
/dxxx/dtes

I would like it to list
only the files (or directory names)
in the CURRENT directory, that is,
these two:

/dirs
/dxxx

I have tried many variations of -prune
with no luck.
Can anyone tell me how to do this?

Thanks,
Ed Bachmann
UNC-Chapel Hill

2. PCI cards

3. Way to get find to skip a directory?

4. Why is it so quiet over in comp.os.ms-windows.advocacy?

5. WHy does up2date skip package NOT in the skip list

6. samba problem

7. Hexdump: skip does not skip

8. help on sleep_on/wake_up()

9. SKIP for Linux and Sunscreen SKIP for W95

10. Skipping directories in backups

11. recursive listing skipping specific directories

12. SEGV in NFS in deep directory (was: bash: looping over all files in directory)

13. how to skip nfs umount during system shutdown?