[Techtalk] ls display

Anne Wainwright anotheranne at fables.co.za
Wed Oct 15 20:46:55 UTC 2008


Michelle, hi.

On Wed, 15 Oct 2008 01:30:45 +0200
Michelle wrote:

|> Again me.. :-/
|> 
|> If you want to show only the directories why not:
|> 
|>     ls -dArX */ .*/

To which I might reply 'why, indeed!'

Well I have played around and worked through that, but one might imagine that with all the options for ls that one alone would show just the directories. Still, why be simple ;)

I finally settled on 

	ls -dlrX */ 

as fitting my needs. (but ls -drX --width=1 */  is also nice!)

Frustratingly I tried to make it go with the -I option but could not figure out how to negate a pattern.

Interestingly my DEBIAN BIBLE by Steve Hunger shows '/' as an option of ls, but of course it doesn't work as an option. He doesn't show a '-' so is tricking the reader into using a simple pattern

Furtherly interestingly, the reason why this is only necessary in the home directory are still hidden. A simple ls -lrX does the job in a subdirectory even if showing all the other files above.

Even more interestingly neither man nor info mention the use of a pattern save with the --ignore option.

Michelle, very elegant if a trifle --verbose  ;)



Thanks so much
Anne

-- 
so much to do, so little time :(
when I grow up I'll learn enough to actually help others on this group just like Michelle!


More information about the Techtalk mailing list