undoing changes to bashrc from terminal

后端 未结 5 1430
半阙折子戏
半阙折子戏 2021-01-12 11:03

Unfortunately I just overwrote my .bashrc with

echo \"command\" > ~/.bashrc

as opposed to append

5条回答
  •  攒了一身酷
    2021-01-12 11:55

    Sharing the link to an answer in another post which helped me. https://stackoverflow.com/a/40214165/13151296 If you only added a few touches to your bashrc, you can use this to get a fresh default bashrc and then add what you need using methods in previous answers of this thread.

    Type the following in your terminal,

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

    It will replace your corrupt ~/.bashrc with a fresh one. After that you need to source the ~/.bashrc so that the change take place immediately, write in terminal,

    source ~/.bashrc

    or if that does not work you can close the terminal and open it again.

提交回复
热议问题