我想我搞乱了我的.bash_profile和.bashrc文件。
有什么办法可以将它们重置为默认值吗?
当我想要通过终端访问它们时,我得到的信息是:许可被拒绝。
如果我使用sublime文本打开它们,我的.bashrc是完全空的,并且我的.bash_profile包含以下代码:
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH=/usr/local/bin:$PATH
alias python=python3
alias sublime="open -a /Applications/Sublime\ Text.app"
source ~/.profile
你知道我可以在任何文件中添加/删除什么吗?
Python不能正常运行了,因为我不小心处理了这些文件。
发布于 2019-11-29 23:28:53
您可以在/etc/skel/中找到默认的.bash_profile和.bashrc文件
[user@server /]$ ls -la /etc/skel
total 28
drwxr-xr-x. 3 root root 78 Jan 3 2019 .
drwxr-xr-x. 131 root root 12288 Nov 7 13:03 ..
-rw-r--r--. 1 root root 18 Oct 30 2018 .bash_logout
-rw-r--r--. 1 root root 193 Oct 30 2018 .bash_profile
-rw-r--r--. 1 root root 231 Oct 30 2018 .bashrc
如果是这样的话,你可以把它们找回来:
cp /etc/skel/.bash_profile /etc/skel/.bashrc ~/
备份您当前的文件之前;)
只是为了解释一下: /etc/skel/的内容在使用adduser创建时被复制到用户的主目录中。
https://stackoverflow.com/questions/59087438
复制相似问题