Mailinglist Archive: opensuse (4547 mails)

< Previous Next >
Re: [SLE] Is there a "find file on system" command?
  • From: Jerome Lyles <susemail@xxxxxxxxxxxxx>
  • Date: Tue, 18 May 2004 21:59:05 -1000
  • Message-id: <200405182159.05698.susemail@xxxxxxxxxxxxx>
On Monday 17 May 2004 04:22 pm, Robert Paulsen wrote:
> On Monday 17 May 2004 19:35, James Knott wrote:
> > Robert Paulsen wrote:
> > > On Monday 17 May 2004 03:43, Jerome Lyles wrote:

> > >
> > > You need to put quotes around the expression you are looking for if it
> > > contains special characters that the shell will act on (in your case
> > > the *). Try this...
> > >
> > > find / -name "*.rpm"
> > >
> > > You want the find command to see the *, not the shell.
> >
> > It works fine for me without the quotes. However, this is on Red Hat
> > 7.3.
>
> If there are no *.rpm files in the current directory then it will work w/o
> the quotes. Try the following:
>
> touch xxx.rpm
> find . -name *.rpm
> find . -name "*.rpm"
>
> Assuming there are some rpm files to find in subdirectories you should see
> the difference.
> --
> Robert C. Paulsen, Jr.
> robert@xxxxxxxxxxxxxxxxx

I tried it and I do see the difference! So, if there are rpms in the current
directory then the shell expands the special character *. If there are not
rpms in the current directory then the shell does not expand the special
characters for other directories.
This is useful to know, thank you,
Jerome


< Previous Next >
Follow Ups