0

I am new to Ubuntu (or any Linux distro) and I encountered a problem where I cannot cd into etc/profile. I was trying to edit the bashrc so that I could change the colours in my terminal window.

I tried to ls inside the /etc/ file, and I see that there is a profile file there; but I can't enter it.

1
  • 3
    /etc/profile is not a directory, it is a file. There's an /etc/profile.d directory, though.
    – muru
    Apr 16, 2016 at 18:44

2 Answers 2

2

The reason why this fails is because /etc/profile is not a directory (unless you meant /etc/profile.d, but I don't think you did)

Instead use gedit ~/.profile
If you want to edit .bashrc: gedit .bashrc

1

By default /etc/profile is not a folder but a file so you can't cd into it.

The global bashrc file is /etc/bash.bashrc

5
  • I found the bash.bashrc file, but when I get down to the part where I am supposed to modify the colours, I see this: # set a fancy prompt (non-color, overwrite the one in /etc/profile) PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' Apr 16, 2016 at 18:49
  • 1
    @gloriousCatnip if you want to modify colours, do that in your own ~/.bashrc, not the system-wide /etc/bash.bashrc.
    – muru
    Apr 16, 2016 at 18:51
  • I nano'ed into ~/.bashrc, but it seems to be a copy of the aforementioned file. Apr 16, 2016 at 18:53
  • @gloriousCatnip you'll see similarities, but they shouldn't be the same.
    – muru
    Apr 16, 2016 at 18:54
  • Hmm, nope. I can't find any settings regarding colour change. I followed a tutorial saying I should change the line proceeding this: if [ "$color_prompt" = yes ]; then But there are no such lines in my bashrc, are there any way to reset it to its original content? Apr 16, 2016 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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