l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2001 Dec 30 16:59

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Red Hat Soundblaster Setup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Red Hat Soundblaster Setup

rusty, here are some examples of find.  sometimes the syntax can be a little
confusing, but the more you use it the more you get comfortable with it.
find is very powerful.

list all files on the system:

        find /

list all files starting from /usr/local/tex on downwards:

        find /usr/local/tex/

find any file containing the string "hello", starting from /usr/local going
on downwards.  it -print's the result.  you don't have to use -print since
that's the default behavior, so these two are equivalent:

        find /usr/local/ -name "*hello*" -print
        find /usr/local/ -name "*hello*"

-exec allows you to perform a command on matched files.  this chmod's ALL
files starting from /home going on downwards.  the \{} expands to the name
of the matched file.  i'm not sure what \; is.

        find /home/ -exec chmod go-rwx \{} \;

here's how to delete all empty files starting with /var on downwards:

        find /var/ -empty -rm \{} \;

find all suid programs in /opt:

        find /opt -perm +4000

i'm not entirely sure, but i think this ought to delete all files on your
system.  of course, i'm not willing to try it out.  see if you can figure
out why i say it should delete ALL files on the system.

        find . -name ".*" -exec rm \{} \;

chmod all files, starting with the current directory, but ASK if it's ok
before performing the chmod.  kind of like mv -i or cp -i

        find . -ok chmod ugo-rwx \{} \;

see man find for more details.

there's also something called xargs, which i never learned how to use.
maybe someone on the list will explain how to use it.

On Mon 29 Jan 01,  1:40 PM, Rusty Minden said: 
> Peter Wrote
> >find / -name "sndconfig"
> I thought that with find you just entered
> #find sndconfig
> This may be my error. So I need to use
> #find / -name "sndconfig"
> What does this do does it say to look for a file or directory named
> sndconfig? I. E. the / says to lookh for a file or directory and the -name
> tells it that it is the name of the file or directory and the "sndconfig"
> says to look for sndconfig?
precise-amundo.   you can use globbing, just quote the name, ie:

        find / -name "*config"

different tools for the job.  you want to:

1. find a file which may be in your $PATH:    which
2. find a file anywhere on the system:        locate
3. find a file anywhere based on a complicated choosing procedure and
        do something with that file                find || (locate && xargs)


LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!