Ubuntu 12.04.5 LTS 64bits using bash

I would like to change the color of the comments (Dark blue) for nano and pico

I can change the color of pretty much every files and folders in /home/.dircolors but I cannot find how to change the comments into an existing file.

Thank you!

  • are you using gnome-terminal ? if yes i can help – edward torvalds Nov 20 '14 at 20:51
  • if you are not using gnome-terminal, find the configuration file of that particular terminal(do a search on web). for gnome-terminal its in ~/.gconf/apps/gnome-terminal/profiles/Default, file- %gconf.xml – edward torvalds Nov 20 '14 at 21:02
  • I found a new method for your question. are you still interested to know ? – edward torvalds Dec 9 '14 at 10:17

Go to the /usr/share/nano directory and check out the *.nanorc files there. For example, to change the comment color in PHP, edit /usr/share/nano/php.nanorc and change:

## comments
color brightblue "//.*"
color brightblue start="/\*" end="\*/"


## comments
color brightgreen "//.*"
color brightgreen start="/\*" end="\*/"

...which is much less invisible when using PuTTY.

This information could also be entered into a ~/.nanorc file for an individual user.

Open Gnome termial. Remember what is the color of comment you want to change. then Edit > Profile Preference, then goto the "Color" tab. at the bottom you will see color pallete. then find the color your kept in mind, then change it by clicking and setting it to whatever you want.
Done, its simple !

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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