如圖,怎樣把圈著的這個值給洗掉了,我覺得這個路徑影響到了我別的軟體搜索路徑
uj5u.com熱心網友回復:
直接給它重新賦正確的值uj5u.com熱心網友回復:
用戶級的path修改用戶檔案夾下的.profile檔案 系統級的話修改/etc/profileuj5u.com熱心網友回復:
PATH這個變數其實是開機自動設定的,如果想臨時改變它的值只需要命令列中PATH='...' 直接設定。
如果想讓永久改變的它的值,需要去修改某些檔案,但也分用戶,如果是對所用用戶修改,就需要用root用戶去修改 /etc/profile 或者 /etc/bashrc (這兩個檔案只需要修改一個,不同的distribution檔案名可能會稍有不同)。
如果是想要修改僅對當前用戶生效,則修改該用戶主目錄下的 .profile 或者 .bashrc 檔案。
至于怎么修改,則根據需要自己決定。比如想要讓PATH中的某一個欄位不在出現,可以嘗試找一找上面四個檔案中在哪里添加的這一個欄位,將那個欄位洗掉保存就好了。上述檔案修改保存后不會立即生效,但是在系統下一次重啟之后,就可以生效了,如果是為PATH增加欄位的話,則可以通過source命令令其立即生效。
uj5u.com熱心網友回復:
重新賦值是臨時的還是永久的uj5u.com熱心網友回復:
用戶級的.profile修改哪個地方,下面是我的.profile內容 1 # ~/.profile: executed by the command interpreter for login shells.2 # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
3 # exists.
4 # see /usr/share/doc/bash/examples/startup-files for examples.
5 # the files are located in the bash-doc package.
6
7 # the default umask is set in /etc/profile; for setting the umask
8 # for ssh logins, install and configure the libpam-umask package.
9 #umask 022
10
11 # if running bash
12 if [ -n "$BASH_VERSION" ]; then
13 # include .bashrc if it exists
14 if [ -f "$HOME/.bashrc" ]; then
15 . "$HOME/.bashrc"
16 fi
17 fi
18
19 # set PATH so it includes user's private bin if it exists
20 if [ -d "$HOME/bin" ] ; then
21 PATH="$HOME/bin:$PATH"
22 fi
23
24 # set PATH so it includes user's private bin if it exists
25 if [ -d "$HOME/.local/bin" ] ; then
26 PATH="$HOME/.local/bin:$PATH"
27 fi
uj5u.com熱心網友回復:
這四個檔案里只有.profile里有PATH,但是我不知道怎么修改,是把那一行洗掉嗎,11 # if running bash12 if [ -n "$BASH_VERSION" ]; then
13 # include .bashrc if it exists
14 if [ -f "$HOME/.bashrc" ]; then
15 . "$HOME/.bashrc"
16 fi
17 fi
18
19 # set PATH so it includes user's private bin if it exists
20 if [ -d "$HOME/bin" ] ; then
21 PATH="$HOME/bin:$PATH"
22 fi
23
24 # set PATH so it includes user's private bin if it exists
25 if [ -d "$HOME/.local/bin" ] ; then
26 PATH="$HOME/.local/bin:$PATH"
27 fi
我是想把26行這個路徑刪了
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/103242.html
標籤:系統維護與使用區
