PATH路径简单理解
[[email protected] kang]# vi yy
echo YY
[[email protected] kang]# chmod +x yy
[[email protected] kang]# ./yy
YY
[[email protected] kang]# pwd
/root/kang
目的修改PATH路径,让用户在任何目录下输入yy都可执行
[[email protected] kang]# PATH="$PATH:/root/kang"
[[email protected] kang]# echo $PATH
/usr/local/java//bin:/usr/local/java//bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/kang
验证:
[[email protected] /]# pwd
/
[[email protected] /]# yy
YY
原文地址:http://blog.51cto.com/12965094/2115539
时间: 2024-10-09 16:50:47