4

I am logged into a remote shell and I had root access to this. I was trying to edit my .bashrc and .bashrc_profiles files when suddenly my connection snapped, leaving the files open. I suspect something went wrong. How can I restore these files from the command line?

I tried copying from /etc/skel, however my cp command is also not working. Neither do nano or vim work.

emk2203
  • 4,393
  • 1
  • 26
  • 52
User3
  • 143

1 Answers1

4

It sounds like you broke your $PATH. That's easy to fix though, you can still use the full path to a command. So, for example, to get the default .bashrc back, you can do:

/bin/cp /etc/skel/.bashrc ~/

Same for nano and vim, just use /bin/nano and /usr/bin/vim. Finally, note that there's no such thing as .bashrc_profiles. There is ~/.profile, ~/.bash_profile (if this file exists, ~/.profile is ignored by bash), and ~/.bashrc.

terdon
  • 104,119