
-----------------------------------
jamonathin
Sat Sep 22, 2007 10:28 am

Unix Filenames help
-----------------------------------
Hey all,

I need to find a count all 4 letter files that start with a, s, r, t  in a user-specified directory.

I can't for the life of me figure this out or find bits of help on it.  What i have so far only lists the t's (from the user-specified /bin for now), but the problem is, it also includes  crap like "panel-test-applets" and  "test-moniker" in the count.

This is all i've been able to come up with, im not shure on how to also search for the s, r and a with that
ls -1 /bin | grep -w 't...' | wc -l

-----------------------------------
Mazer
Sat Sep 22, 2007 12:30 pm

RE:Unix Filenames help
-----------------------------------
Can't you use '?' as a wildcard for just a single character?

-----------------------------------
jamonathin
Sat Sep 22, 2007 12:48 pm

Re: Unix Filenames help
-----------------------------------
Thats what i thought at first, because thats what you can do with many other commands, but it doesn't work, and in this case, the ' . ' substitutes for the ' ? ' (took me a while to find that out).  but i could probabily be wrong, using the wrong syntax

-----------------------------------
OneOffDriveByPoster
Sun Sep 23, 2007 9:11 am

Re: Unix Filenames help
-----------------------------------
maybels -1 /bin/

-----------------------------------
jamonathin
Sun Sep 23, 2007 3:08 pm

Re: Unix Filenames help
-----------------------------------
That works perfectly, thanks a million man - and it's quite simple to understand.

+ Bits
