0

This question already has an answer here:

I want to change the colors of root@MyComputer:~#and when i type the ls command show me the result as colors!

I write a simple BB code to display what i want:

[color=red]root@MyComputer:[/color][color=blue]~[/color]# 

I had this command but it does not apply whan open a new terminal window

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\:\[\033[01;34m\]\w\$ '

thank you in advance

marked as duplicate by jasonwryan, Archemar, G-Man, Rui F Ribeiro, slm linux Jun 30 '16 at 10:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The questioner already knows how to change the colour (using hardwired control sequences, alas). Xe is asking how to make the PS1 setting persistent in subsequent shells. – JdeBP Jun 30 '16 at 7:42
0

If your command works, simply put it in $HOME/.bashrc if you are using a bash shell.

$HOME will be /root for root, /home/XYZ for user XYZ, etc. For ls command, you can create an alias like so (again, in bashrc):

alias ls='ls --color=auto'

You can always source the .bashrc file too in your current shell if you, for some reason, do not want to spawn a new one.

  • thinks it work! – AbA2L Jul 1 '16 at 10:41

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