日期:2014-05-16  浏览次数:20611 次

如何删除PATH路径下的目录
# echo $PATH
/usr/kerberos/sbin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/real/RealPlayer:/home/chensheng/bin:/opt/Gamit_Globk/com/:/opt/Gamit_Globk/gamit/bin:/opt/Gamit_Globk/kf/bin:/opt/real/RealPlayer:/opt/real/RealPlayer:/opt/Gamit_Globk/com:/opt/Gamit_Globk/gamit/bin:/opt/Gamit_Globk/kf/bin:/root/cheng
     我有几个路径目录重复了,想删除一个不知到怎么改,只会添加!
------解决方案--------------------
http://blog.csdn.net/debug_cpp/archive/2008/07/20/2679991.aspx

可以用命令删除,也可以找到文件,删除$PATH的对应内容
------解决方案--------------------
export PATH=$(echo $PATH 
------解决方案--------------------
 tr : "\n"
------解决方案--------------------
 sort 
------解决方案--------------------
 uniq 
------解决方案--------------------
 tr "\n" :)