3

I do know I can color my terminal using the PS1 variable.

Now, I would like to discover if there is a way to put some color on the bash commands I often use.

I'd like to type, something like, "$ ls /home" and the command 'ls' shows in green, or something like that.

Is it possible?

-1

From man page:

   --color[=WHEN]
          colorize the output; WHEN can be 'always' (default if
          omitted), 'auto', or 'never'; more info below

To make it the default behaviour, just create an alias.

alias ls="ls --color=auto"
  • 1
    The OP is looking for a way to colourise the command on their prompt, not the output from the command. – n.st Aug 4 '17 at 16:18
  • @n.st Excuse me, I think you're right. – Lara Maia Aug 4 '17 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.