Using wildcards to avoid having ls
running the directory listing is suboptimal, because it prevents you from using ls
options like --almost-all
.
Like Enzotib's suggestion, the simplest way to remove it is to pipe it through tail
to chop off the first line. However, ls
will detect that it its output is a pipe rather than interactive, and change its defaults in an unwanted way. Hence, to make it robust, you should also add some options:
--color=always
: keep showing colors
--hide-control-chars
: print ?
in filenames in place of control characters that could mess up the console output
I have a script ~/bin/l
(you could also use a Bash alias in ~/.bash_aliases
):
#!/bin/bash
ls -l --color=always --hide-control-chars "$@" | tail --lines=+2
You can also add any other ls
options you want by default, e.g. --group-directories-first --time-style='+%FT%T.%N%:::z' --indicator-style=slash
.
ls -l | tail -n+2
, for the rest I do not have an answer. – enzotib Sep 13 '11 at 9:25lsl
. Just 3 letters ;) oh and ls -lh shows me 1.2K styled sizes. – Rinzwind Sep 13 '11 at 9:30