Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ls command runs off page 4

Status
Not open for further replies.

testman1

Vendor
Oct 7, 2007
135
US
Can someone tell me how to use the ls command so that it doesn't run off the page; something like the the DOS dir /w.
Thanks.
 
Like in DOS, you can pipe the output through a pager, e.g. ls | more or ls | less.

Annihilannic.
 
Thought the /w in DOS means "wide". Even then you needed to use MORE with dir to paginate the output. ls already displays entries in a wide (columnar) format unless you use the -1 (the number one) or -l (the alpha L).

--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
I usually set up an alias for users called "dir" that equals "ls -al | more".
 
That was helpful.
I modified it to: ls -al --color=always | more
I found a way to have the pipe put the color back in.

It's always an adventure.

thanks again.
 
zeland gets a star from me cuz I didn't know about the -1 option to ls (it doesn't seem to be mentioned on the man page).

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top