PATH問題請教

[复制链接]
查看11 | 回复5 | 2009-5-27 16:08:52 | 显示全部楼层 |阅读模式
在ROOT用戶下,可以用echo $PATH顯示如下
# echo $PATH
/usr/sbin:/usr/bin
請問,PATH路徑是在哪個文中設定的,我要加上一個路徑到PATH路徑下該如何做?
回复

使用道具 举报

千问 | 2009-5-27 16:08:52 | 显示全部楼层
You can write the enviroment variable directly like this:
$ path=$path:/home
or
You may edit the .profile(I can't remember this method very clearly)
回复

使用道具 举报

千问 | 2009-5-27 16:08:52 | 显示全部楼层
在PATH中用方法1是可以暫時將我的路徑加上去,可是當退出再進去後,又恢復成原來的樣子了
回复

使用道具 举报

千问 | 2009-5-27 16:08:52 | 显示全部楼层
You can try the second method that edit the file called .profile!
Shell will read this file automatically whenever you login!
回复

使用道具 举报

千问 | 2009-5-27 16:08:52 | 显示全部楼层
another method:
You can write a script like this:
$PATH=.......... every path you want to put in
export PATH
Unfortunatly,you must run this script every time you login!
回复

使用道具 举报

千问 | 2009-5-27 16:08:52 | 显示全部楼层
修改/etc/profile把PATH路径加入进去
然后是使用export PATH
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行