[linux-help] Re: ls
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
No. It only shows the ones in the current directory. I'm running Mandrake (7.0)
and I just tried it. I have a file called x.html in a subdirectory, I touched
two files in the directory above it, x1.html and x2.html. I do ls x* and I get
only the files in the directory I'm in. I do find . -name "x*" and it finds
all three (and a bunch of other junk starting with x under .kde, .netscape,
office52, etc).
ls has always searched only the current directory. To change it to do
subdirectories would totally screw lots of people up.
Greg
On Sat, 02 Sep 2000, you wrote:
> In Mandrake, ls lar* will show all non-executable files beginning with lar in
> the
> directory and subdirectories. Executable files won't be shown.
> bruce
>
> Carl D Cravens wrote:
>
> > On Sat, 2 Sep 2000, Gary Gaston wrote:
> >
> > > To look for a file that starts with "set" use the following: ls set*
> > > This
> > > will search the current directory and all subdirectories.
> >
> > Eh? ls doesn't search subdirectories. "set*" is expanded by the shell,
> > before it's ever sent to ls, into files that match in the current
> > directory. It'll show you the contents of any directories that start with
> > "set" in the current directory, but it won't look any further than that.
> >
> > To search for a file, use "find".
> >
> > find ./ -name 'set*'
> >
> > "xargs" is a good program to know about when using find. It's usually
> > more efficient that the -exec option of find if you want to execute a
> > program on the results.
> >
> > find ./ -name 'set*' |xargs ls -ld
> >
> > --
> > Carl D Cravens (raven@xxxxxxxxxxx)
> > I've got a chainsaw... what could go wrong?
> >
> > -- This is the linux-help@xxxxxxxxx list. To unsubscribe,
> > visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
>
>
> -- This is the linux-help@xxxxxxxxx list. To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
--
----------
"Hang loose, baby. You'll get your new wings soon." - Is. 40:31
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
[linux-help] Re: ls, Jonathan Hall, 2000/09/02
[linux-help] Re: ls, Jonathan Hall, 2000/09/02
[linux-help] Re: ls, John, 2000/09/02
|
|