I would be very reluctant to start any 'find' command from root (/). You
can never tell what may be mounted to your system via either rmount or
mount. You can go looking through a mounted cdrom looking for a core file
to delete if you want to (mounted on /cdrom) but it seems like a waste of
time to me.
I generally prefer to limit my search to a few selected directories. 'find'
allows the user to string out any number directories to search, for example,
to search just the foxboro directories, issuing the command:
find /usr/fox /opt/fox -name core -print . . .
will find the files named core in /usr/fox and /opt/fox.
John Windle
> -----Original Message-----
> From: Joe Markham [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, September 25, 2000 8:43 PM
> To: 'Foxboro DCS Mail List'
> Subject: RE: find command ussage?
>
> I think that something like this would work if you just want the full
> names
> of the core files:
>
> find / -fstype urfs -prune -o -name core | egrep -v '^/rem'
>
> This just takes the output from the find command, sends it to the egrep
> program which will print all the lines that don't begin with /rem. This
> output should have just the files that you were looking for.
>
> On my system, the command
> find / -fstype urfs -prune -o -name core
> prints
> /usr/menus/d1/core
> /usr/menus/cntrl/core
> /usr/menus/overlays/core
> /usr/menus/trends/core
> /core
> /rem/AW0001
> /rem/AW0002
> /rem/WP0001
> /rem/WP0002
>
> and the command
> find / -fstype urfs -prune -o -name core | egrep -v '^/rem'
> prints
> /usr/menus/d1/core
> /usr/menus/cntrl/core
> /usr/menus/overlays/core
> /usr/menus/trends/core
> /core
>
>
> Of course, if you want to delete the core files, try:
> find / -fstype urfs -prune -o -name core -print -exec rm {} \;
>
> the -print means print the file names (this happens by default if find is
> not told to do anything with the files it finds, which is why it prints
> them
> without it in the previous examples)
>
> the -exec rm {} \; means execute rm with the file name in place of the {}.
> The \; terminates the -exec command.
>
> WARNING!! Be carefull! Using -exec rm {} with find can be hazardous to you
> hard drive! If you try something like
>
> #don't do this!!
> find / -name 'r*' -print -exec rm {} \;
> #don't do this
>
> You can make your system unusable. Try just printing out the files found
> first. If the list looks good, try the same find command with the -exec
> option.
>
> -JAM
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Stan Brown
> Sent: Monday, September 25, 2000 6:47 PM
> To: [EMAIL PROTECTED]
> Subject: Re: find command ussage?
>
>
> On Mon Sep 25 15:30:23 2000 Brian Bates wrote...
> >
> >
> >Stan, use find / -fstype urfs -prune -o -name core
> > I think Harry Forbes deserves the credit - I deleted the email, but
> saved
> >the tip :->>.
> >See below, run on a AW51B V4.3. It shows the rmounted sun boxes, but
> does
> >not look at their HDD's for core files.
> >
> >051A02# find / -fstype urfs -prune -o -name core
> >/usr/fox/ia16/usr/rnews/core
> >/usr/rnews/core
> >/var/tmp/core
> >/rem/761A02
> >/rem/031A01
> >/rem/141A01
> >/rem/141W01
> >/rem/141W03
> >/rem/141W07
> >/rem/151A01
> >/rem/151A02
> >/rem/131A01
> >/rem/041A03
> >/rem/221A01
>
> I am missing something here. This does not do what I want. Envision
> that
> the
> output of this command is to be passed to rm for periodic file
> cleanup. I
> wnat
> to kill the core files, but not /rem/761A02 for instance.
>
> I must not be staeing the problem description clearly. Let me try
> again.
>
> I want to search all _locally_ mounted filesystems, skiping all
> remotely
> mounted (NFS URFS, whatever) filesystems, without getting all the
> error
> messages from mangled symlinks within the /rem tree, that you will
> get
> from:
>
> find / 0name core -print.
>
> I wish to do this _without having to lookup what file-systems are
> mounted
> (in
> the /etc/fstab file for instance).
>
> Does that make it clearer?
>
>
> --
> Stan Brown [EMAIL PROTECTED]
> 843-745-3154
> Charleston SC.
> --
> Windows 98: n.
> useless extension to a minor patch release for 32-bit extensions and
> a graphical shell for a 16-bit patch to an 8-bit operating system
> originally coded for a 4-bit microprocessor, written by a 2-bit
> company that can't stand for 1 bit of competition.
> -
> (c) 2000 Stan Brown. Redistribution via the Microsoft Network is
> prohibited.
>
> -----------------------------------------------------------------------
> This list is neither sponsored nor endorsed by the Foxboro Company. All
> postings from this list are the work of list subscribers and no warranty
> is made or implied as to the accuracy of any information disseminated
> through this medium. By subscribing to this list you agree to hold the
> list sponsor(s) blameless for any and all mishaps which might occur due to
> your application of information received from this mailing list.
>
> To be removed from this list, send mail to
> [EMAIL PROTECTED]
> with "unsubscribe foxboro" in the Subject. Or, send any mail to
> [EMAIL PROTECTED]
>
>
> -----------------------------------------------------------------------
> This list is neither sponsored nor endorsed by the Foxboro Company. All
> postings from this list are the work of list subscribers and no warranty
> is made or implied as to the accuracy of any information disseminated
> through this medium. By subscribing to this list you agree to hold the
> list sponsor(s) blameless for any and all mishaps which might occur due to
>
> your application of information received from this mailing list.
>
> To be removed from this list, send mail to
> [EMAIL PROTECTED]
> with "unsubscribe foxboro" in the Subject. Or, send any mail to
> [EMAIL PROTECTED]
-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.
To be removed from this list, send mail to
[EMAIL PROTECTED]
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]