Discussion:
[PLUG] Searching all filesystems except /proc
Rich Shepard
2018-09-30 21:46:56 UTC
Permalink
I want to exclude /proc from being examined by 'find' when searching for
a file from /. I did not see an option in the man page to exclude specific
partitions. Is there a way to have find ignore /proc?

Rich
David Fleck
2018-09-30 22:29:18 UTC
Permalink
On Sun, 2018-09-30 at 14:46 -0700, Rich Shepard wrote:
> I want to exclude /proc from being examined by 'find' when searching for
> a file from /. I did not see an option in the man page to exclude specific
> partitions. Is there a way to have find ignore /proc?

Not exactly what you want, but you can specify file system type with 
-fstype xxx. Anything in /proc is fstype 'proc', so maybe you could
specify "! -fstype proc" as one of your sets of arguments to find.
Rich Shepard
2018-09-30 22:59:16 UTC
Permalink
On Sun, 30 Sep 2018, David Fleck wrote:

> Not exactly what you want, but you can specify file system type with 
> -fstype xxx. Anything in /proc is fstype 'proc', so maybe you could
> specify "! -fstype proc" as one of your sets of arguments to find.

David,

This looks like it will do the job. I'll use this in an alias so it's the
default for find.

Thanks,

Rich
J. Hart
2018-10-01 00:37:54 UTC
Permalink
You may also wish to avoid searching in any active mount points under
root (directories with additional filesystems (e.g. other drives)
mounted on them. The switch "-xdev" will prevent "find" from
descending into those other filesystems).

On 09/30/2018 05:46 PM, Rich Shepard wrote:
> I want to exclude /proc from being examined by 'find' when searching
> for
> a file from /. I did not see an option in the man page to exclude
> specific
> partitions. Is there a way to have find ignore /proc?
>
> Rich
> _______________________________________________
> PLUG mailing list
> ***@pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
King Beowulf
2018-10-01 01:26:08 UTC
Permalink
On 9/30/18 2:46 PM, Rich Shepard wrote:
>   I want to exclude /proc from being examined by 'find' when searching for
> a file from /. I did not see an option in the man page to exclude specific
> partitions. Is there a way to have find ignore /proc?
>
> Rich

If you are just looking for regular files, as in files you create, or
configuration files, or a binary. library, etc etc, use slocate. Find is
handy but is a bit overkill.

As root, run

# updatedb

Then as regular user

$ locate <filename> [ | grep <pattern> ]

Also, check out
http://www.slackbuilds.org/repository/14.2/desktop/catfish/

-Ed
Loading...