1

Recently, my terminal stopped showing color, so all text is white, and also some commands like l don't work anymore.
I've tried commands like sudo apt-get reinstall gnome-terminal, but then I realised Guake had the same effect. Can anyone explain this?

  • Sounds like you’ve done something to your bash profile – matigo May 14 '22 at 11:05
  • 1
    Some possibilities (1) your terminals are using some other shell instead of bash (2) the bash shell in your terminals is no longer sourcing your ~/.bashrc file (3) you modified your ~/.bashrc file so it is no longer applying color settings or defining the l alias. – steeldriver May 14 '22 at 11:10
  • @steeldriver, I can't find ~/.bashrc. Maybe I've deleted that file accidentally? – thes_real May 14 '22 at 13:10
  • If you're checking with a file manager, remember to turn on "Show hidden files". OTOH if you really have deleted it, that would explain why the shell is no longer sourcing it ;) You can obtain a copy of the default ~/.bashrc from the /etc/skel directory ex. cp -i /etc/skel/.bashrc ~/ – steeldriver May 14 '22 at 13:18
  • I know, @steeldriver! – thes_real May 14 '22 at 13:18

2 Answers2

0

I've found an answer, thanks @steeldriver!
The fix was posted on How do I restore .bashrc to its default? and the answer is to just copy /etc/skel/.bashrc to ~

0

I assume you are using the standard bash shell. Use this to confirm.

echo "$SHELL" 

Next, check that you have a bash profile:

ls ~/.bashrc 

If this does not return anything, then you have nuked your profile. So lets get you a clean profile. This will give you a standard bash profile, but if you managed to remove .bashrc, you would need to check what else you have inadvertently destroyed

cp /etc/skel/.bashrc ~

Then do the spell below to get the bash profile activated :

. ~/.bashrc  

This file has a section between lines 38 and 89 that sets up the terminal colours. You can investigate this, but a detailed explanation is beyond a simple answer. Most people (most Unix experts!) leave this alone.