Re: quick howto-command questions?
On Wed, Mar 21, 2001 at 07:10:03PM -0800, Alexander Poquet wrote:
...
> Apropos, I have a question: frequently I am in a directory (such as /dev,
> for example) which has more stuff in it than I can see in one screenful.
> Normally I pipe it through less, but am bothered by the 'one file per
> line'-isms that ls spits out in this case. I understand the necessity
> of this behaviour, but I was wondering, is there some option which
> forces columnated output regardless of the presence of a filter? -C
> is documented as column-formatting, but it is ignored in a pipe.
Strange, here it works as advertised. What does "type ls" show? Is it
a genuine ls or some build-in degenerate from your shell? Here I get:
$ type ls
ls is hashed (/bin/ls)
$ ls --version
ls (GNU fileutils) 4.0l
$ dir /usr/bin | head -n 2
822-date grepmail.DP popauth
GET grodvi popclient
$ ls -C /usr/bin | head -n 2
822-date grepmail.DP popauth
GET grodvi popclient
$ ls --format=vertical /usr/bin | head -n 2
822-date grepmail.DP popauth
GET grodvi popclient
$ ls --format=horizontal /usr/bin | head -n 2
822-date GET HEAD
Mail MakeTeXPK POST
> In a related question, can one force sort by rows instead of by
> columns, ie, "a b c\nd e f" instead of "a c e\nb d f"? I say related
> because when viewing copious output through a pager, it would be
> useful to have sort by rows instead of by columns, which is the default
> behaviour.
$ ls --format=horizontal
--
groetjes, carel
Reply to: