Click to See Complete Forum and Search --> : redhat linux commands


debbienc
09-20-2005, 09:01 PM
What does the command ls/ etc/ *.?? mean? Also what does ls /etc/[akp]??[0-9]* mean? and last what does ls /etc/[aeior][<aeiou]??[aeiou]* mean? where the < is, is supposed to be a carot, but my computer does not have a symbol like that? I know the ls is a list of files. I know the * means all, but what does the .?? mean? and the brackets?

nabis
09-21-2005, 03:01 AM
That's called bash shell wildcards or patterns. (A rudimentary form of regular expressions).

ls /etc/ *.?? -- list all files that end with a dot and two characters (??)
ls /etc/[akp]??[0-9]* -- list all files that start with either "a", "k" or "p", than have two characters, a number between 0 to 9 and any other character

* - any number of any characters except blanks
[a,b,0-9] - one of listed
? - a single character
{ab,bc} - either "ab" or "bc" string
...
Read man ls and man bash (the "EXPANSION" section).

"<" is an arrow, every keyboard has it.

/etc/[aeior][<aeiou]??[aeiou]* -- looks a little like giberish, file names can't contain an arrow.

bwkaz
09-21-2005, 07:32 PM
where the < is, is supposed to be a carot, but my computer does not have a symbol like that? You mean this symbol?

^

That's shift-6 on my (US layout) keyboard. What keyboard layout are you using?

If that is the character you mean, then it means "not" (but only inside square brackets, and only when it's the first character). [^0-9], for instance, means "any character other than 0 through 9".