Hacker News new | ask | show | jobs
by imiric 1022 days ago
It's hardly one character. I never need the plain output of `ls` in interactive sessions.

Here are my aliases:

    if type exa >/dev/null 2>&1; then
        alias l='exa -alg --color=always --group-directories-first --git'
        alias ll='exa -aliSgh --color=always --group-directories-first --git'
        alias lt='exa -@alT --color=always --git'
        alias lr='exa -alg --sort=modified --color=always --group-directories-first --git'
    else
        alias l='ls -alh --group-directories-first'
        alias ll='ls -al --group-directories-first'
        alias lr='ls -ltrh --group-directories-first'
    fi
I still retain `ls -ltrh` in my muscle memory, but after years of typing it, `lr` has saved me a lot of time and effort.

Aliases are not just a way to type less. They also serve as a way to define configuration. If I ever need to tweak the output for all my usage of `ls`, I can just add it to all aliases, as I've done for `--group-directories-first`.