LS command

Hi there,

Could some body tell me a simple way to get the following output.
The list of directories having atleast five characters.

I know the simplest way is:

ls -ad ?????

but that from 1-5, I want at least 5 characters long directories, I wrote a small awk command line, somthing like:

ls -l | awk '/^d/ && lenght($9)>=5 {print $0}' (somthing like that)
which works, but is there an easy way?

Help me out... thanx!
M

How about:
ls -ad ?????*

nah, it doesn't work, thanx for the try though...

:slight_smile:

This was asked a couple weeks ago.

I just retested it and it continues to work for me. What system are you using? What shell? I was on SunOs 5.8 and ksh.

Thanx Guys!

I was using CygWin, I guess its not a good idea to test everything there.

Anyways I came up with something what "oombera" has mentioned.

its like:

ls -ld | awk 'length($9)>=5 {print $0}'

Thanx a bunch again..