Listing as many columns as you like
Posted: 27 May 2012, 15:54
This is not very high tech but I find myself using it quite a lot.
Often when I do a ls I get 8 columns and little water between the boats. Other times I want more columns due to the volume. So I made some aliases like this and put it in my ~/.alias file:
So if I want to list everything in 4 columns I only have to do a ls4 5 columns = ls5 etc.
There will be no prizes for guessing what line to add to get 11 columns
Often when I do a ls I get 8 columns and little water between the boats. Other times I want more columns due to the volume. So I made some aliases like this and put it in my ~/.alias file:
Code: Select all
alias ls4='ls | pr -T4 -W$COLUMNS'
alias ls5='ls | pr -T5 -W$COLUMNS'
alias ls6='ls | pr -T6 -W$COLUMNS'
alias ls7='ls | pr -T7 -W$COLUMNS'
alias ls8='ls | pr -T8 -W$COLUMNS'
alias ls9='ls | pr -T9 -W$COLUMNS'
alias ls10='ls | pr -T10 -W$COLUMNS'
So if I want to list everything in 4 columns I only have to do a ls4 5 columns = ls5 etc.
There will be no prizes for guessing what line to add to get 11 columns