Show escaped bash color codes in less #linux
My ls command colors directories and files according to their type and permissions:
But when the window is too small to fit the content I pipe the result into less:
Which cannot correctly parse the escape code from ls and turn them into color. To fix that add -r to the less command:
Notes:
My
lalias isgls -F -G --color --group-directories-first -lah(glsis GNU ls)
TweetYou can
alias less=less -rif you want this to be the default behavior for less.