PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

ls recursively


Your Ad Here

Your Ad Here

It's a subtle "gotcha". Here's the important bit: Wildcard expansion happens first. Think about that for a minute, and see if you can figure out why it doesn't work. I'll tell you in just a second, but think about what's actaully happening first....

Alright. Let's say that the directory you're in has files "fovb", "govb", "gobv", and directories "mike", "john", and "frank". You type in ls -R *vb, and the wildcard (the asterisk) gets expanded. So, what actually gets executed is:

REMOVE IE 3436
Apr 19, 10:33 am Re: REMOVE IE You didn't read the site. This claim isn't made. I also list "Games." Does that mean I claim that Internet Explorer = Games? The Security...

ls -R fovb govb

Because those are files, not directories, there is no recursion to be performed. Now, had their been a directory "jovb", then *it* would have been included, but not the directories "mike", "john", or "frank".

A couple of ways that (more or less) accomplish what you desire are:

ls -R . efgrep {pattern}

or...

find . -regex {pattern}

Piping ls to grep is the "quick and dirty" route, but find is much more flexible and powerful. I'm sure there are other ways of accomplishing it that don't occur to me, I'm pretty sick with a head cold, and I've had quite a lot of cough syrup tonight. = )



Your Ad Here

List | Previous | Next

REMOVE IE 3436

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

bash scripting challengeproblem