[plug] ls

James Andrewartha trs80 at ucc.gu.uwa.edu.au
Mon Feb 26 22:43:18 WST 2001


On Mon, 26 Feb 2001, Bernard Blackham wrote:

> On, Mon 26 Feb, Ryan wrote:
> 
> > ls -R *.html /
> > or
> > ls -R *.html .
> 
> Does this really work? I'm using bash and it lists everything as I
> would've expected - ls searches for anything *.html in the current
> directory, finds nothing and starts pouring out the root directory et al.

That's because bash globs (expands) the command line, turning *.html into
all the .html files in the directory, eg index.html links.html etc, and
then the final arugment to ls is the root directory, so it lists that as
well. You want ls -R "*.html" / to stop the shell expansion happening.

-- 
"There's nobody getting rich  |  TRS-80              UCC Fresher Rep
 writing software that I      |  Email:    trs80(a)ucc.gu.uwa.edu.au
 know of" - Bill Gates, 1980  |  Web:       http://trs80.ucc.asn.au/




More information about the plug mailing list