/usr/bin/sudo /bin/chmod u+rwx /Users/【账号名】/.bash_profile/usr/bin/sudo /usr/sbin/chown 【账号名】 /Users/yourusername/.bash_profile __EOF__
只需要给自己的用户 编辑权限就行,命令如下: 1、/usr/bin/sudo /bin/chmod u+rwx /Users/username/.bash_profile 2、/usr/bin/sudo /usr/sbin/chown username /Users/username/.bash_profile ps:username就是你自己的用户名,比如我叫zhangsan,直接把命令中的username改为zhangsan即可 3、vim ~/.bash_profile...
检查.bash_profile 文件是否存在及其位置是否正确: 打开终端,输入以下命令来检查 .bash_profile 文件是否存在于你的用户主目录下(即 ~/): bash ls -a ~ 如果列表中没有 .bash_profile 文件,你需要创建一个。可以使用以下命令创建: bash touch ~/.bash_profile 确认.bash_profile 文件的权限设置: 确保....
(6)最后,在终端输入 open .bash_profile 查看环境变量是否已经成功写入文件
子目录可执行bash文章分类运维 1.登录无权访问/etc/profile Last login: Fri Feb 22 10:48:10 on ttys000 -bash: /etc/profile: Permission denied 1. 2. 2.查看权限 sai:~ root# ls -l /etc/profile -rwx--- 1 root wheel 303 2 22 10:10 /etc/profile 1. ...
2、.bash_profile,.bashrc等文件启动关系.在这里我不去动 /etc 系统目录下的配置,一个因为我没有启用root用户,所以只能读不能写,同时也用不着修改它们.因为出问题的时候是在非root用户下。 3、source的简单认识. 添加应用的PATH路径时候自己是没老老实实的填写的,后面少了”:$PATH”等。
profile或者.bash_profile,如果存在没有关系添加进去即可,如果没有生成一个
6,进行保存 全选: command+s 或者不放心的话 选中记事本 文件-保存 保存之后没提示 直接关掉就可以。 7,此时在命令行中输入更新命令(命令行一直不要关): [cpp] view plain copy source .bash_profile OK,重启终端命令行就可以了,eg: 输入ls 原文链接:http://www.apkbus.com/blog-953329-77626.html...
对于 bash 而言,环境变量配置在 $HOME/.bash_profile 中,如果用的 zsh,配置到 .zshrc 中。如果不...