I'm pretty new to Linux, so thanks for taking the time to look at this. I'm simply trying to configure a script to open several new terminals, which works. The problem is that I would like to also color these terminals to my preferences.

I found a site with lots of information about this here: Color Bash prompt (ArchLinux Wiki)

This is the command I run in a live terminal, or via the script:

gnome-terminal --geometry 123x27+-10+14 -x PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'

This is what it returns me:

Failed to execute child process "PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'" (No such file or directory)

Just entering this command in a already running terminal seems to work fine:

PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'

To circumvent this I was also trying to change my /etc/bash.bashrc file, but I had no luck with that modifying my default terminal color.

I understand that the Gnome Terminal has preferences that you can set for colors, but it is far more limited than the command I want to automatically run.

What am I doing wrong?


bash has --rcfile file option, that allows you to specify which config file to chose. It's not an uncommon thing for various profiles to be saved in various files, just consider gnome-terminal itself. I'd suggest you save couple of those custom bashrc files, and then call gnome-terminal -e "bash --rcfile file"

Example in the screenshot:

enter image description here

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.