Chinaunix
标题:
Linux 命令不能用
[打印本页]
作者:
hnnxdjp
时间:
2010-09-21 11:06
标题:
Linux 命令不能用
安装好mysql后,我想让mysql的命令不管在那个路径下都能用,于是修改了/etc/profile文件,不下心把写错了(PATH=PATH:/usr/local/mysql/bin)
结果除了mysql的命令可以用外,其他的系统命令都不能用了,跪求高手帮帮忙!
作者:
chenyx
时间:
2010-09-21 11:12
用绝对路径调用vi,把profile改回去
作者:
renxiao2003
时间:
2010-09-21 11:16
通过菜单打开编辑器,修改你的配置文件。
作者:
惠繪洋
时间:
2010-09-21 11:23
以樓主的講法, 修改 /etc/profile 後, 理論是不會影響現有的命令情況, 除非重新啟動, export 過什么東東或source /etc/profile 才會套用新的設定. 其實只要直接把vi 全路徑輸入, 就可以叫出vi, 重新把/etc/profile改就好了..
其實本人也不太建議直接去改 /etc/profile, 個人的可以在 ~/.bash_profile 或 ~/.bashrc 下加上就可以了.
作者:
nagaregawa
时间:
2010-09-21 12:50
重启吧
作者:
zshyes
时间:
2010-09-21 13:17
支持 ~/.bash_profile 或 ~/.bashrc
或者直接用绝对路径
作者:
383228273
时间:
2010-09-21 13:25
cp@debian:~$ cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
export PATH
umask 022
cp@debian:~$
复制代码
这是我 Linux 系统中的 /etc/profile 文件内容,给楼主参考下!
{:3_190:}
作者:
hnnxdjp
时间:
2010-09-21 13:59
非常感谢,方法很管用!
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2