Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chiragchamoli/04608c87c77ab6c86d3ad76c38dbac7a to your computer and use it in GitHub Desktop.

Select an option

Save chiragchamoli/04608c87c77ab6c86d3ad76c38dbac7a to your computer and use it in GitHub Desktop.
Script to force enable color prompt on Ubuntu and other Linux distros.
#!/bin/bash
# Get the path for the .bashrc file from the prompt or set it as being in the users home dir.
BASHRC="${1:=~/.bashrc}"
# Use sed to remove the comment from the force color line in the .bashrc file.
sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/g' $BASHRC
# BONUS: Uncomment to change the default color of the prompt.
#sed -i 's/1;32m/1;31m/g'
# Reload the .bashrc file
source BASHRC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment