IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

Linux下修改PATH路径

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

1、#PATH=$PATH:/opt/lamp/mysql/bin
使用这种方法,只对当前会话有效,也就是说每当登出或注销系统以后,PATH 设置就会失效

2、#vi /etc/profile
在适当位置添加 PATH=$PATH:/etc/apache/bin (注意:= 即等号两边不能有任何空格)这种方法最好,除非你手动强制修改PATH的值,否则将不会被改变

但一般情况下我们不直接在这里面修改,在/etc/profile开头有这样的提示:

# It’s NOT a good idea to change this file unless you know what you
# are doing. It’s much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

所以:添加一个customer.sh文本文件到 /etc/profile.d/目录下,打开它并敲入

export PATH=$PATH:/opt/lamp/mysql/bin

保存退出,source /etc/profile 立即生效,下一次登陆也会生效

3、#vi ~/.bash_profile
修改PATH行,把/opt/lamp/mysql/bin添加进去这种方法是针对用户起作用的

注意:想改变PATH,必须重新登陆才能生效,以下方法可以简化工作:

如果修改了/etc/profile,那么编辑结束后执行source profile 或 执行点命令 ./profile,PATH的值就会立即生效了。这个方法的原理就是再执行一次/etc/profile shell脚本,注意如果用sh /etc/profile是不行的,因为sh是在子shell进程中执行的,即使PATH改变了也不会反应到当前环境中,但是source是在当前 shell进程中执行的,所以我们能看到PATH的改变。

一般情况下在用户工作目录下的bin目录会包含在PATH路径中,所以只要把用户自己写的shell脚本放在用户的bin目录下就可以了,不需要修改配置文件。


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(82) 打赏



未经允许不得转载:搜云库技术团队 » Linux下修改PATH路径

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367