
Linux only: Reader Chris writes in with an excellent tip that changes the prompt to red when using the root account from the terminal—as a reminder to be more careful.

Using the tip is relatively simple—just edit the /root/.bashrc file and add in the following, preferably commenting out the existing lines that set the color, though you can simply add this line to the end of the file.



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


Once you've added this line, anytime you switch to using the root shell you will see the prompt in red with white text for the command line. Chris takes it further, with a line that turns the prompt green for regular users, which you can enable by adding the following to your ~/.bashrc file:



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

This tip can really come in handy if you have a bunch of terminal windows open at once, so you can tell at a glance which ones are using root mode and which aren't. Thanks, Chris!

For more tips on powering up your terminal, check out how to display your public IP address, show a list of only subdirectories, or make any directory into an ISO file.