Home > OS >  Linux how to delete the PATH variable value
Linux how to delete the PATH variable value

Time:10-02

As shown in figure, how to put the circle of this value to delete, I think the way to my other software search path

CodePudding user response:

Directly give it to the correct values

CodePudding user response:

User level path to modify the user folder. Profile modification/etc/profile file system level

CodePudding user response:

The PATH of the variable is actually boot automatically set, if you want to temporarily change its value only need the command line
PATH='... 'set directly,
If you want to make a permanent change its value, need to modify some files, but also points the user, if it is used for the user to change, you need to use the root user to modify/etc/profile or/etc/bashrc (these two files, only need to modify a different distribution file name may be slightly different),
If want to change is only for the current user, then modify the user home directory. The profile or the bashrc file,
As to how to modify, according to the need to decide on their own, such as to make the PATH of a certain field is not appear, you can try to find the above four file where to add this field, to save the field is deleted, the file will not take effect immediately after the modification of preservation, but after the next system restart, can come into effect, if is to add fields to the PATH, will be the source command to make it effective immediately,

CodePudding user response:

The
reference 1/X - I - n reply:
directly to it to assign the right value
to be temporarily or permanently assignment

CodePudding user response:

refer to the second floor Lz__Heng response:
user level path to modify the user folder. Profile file system level, modify the/etc/profile
user level. The profile, which changes the following is my. Profile content 1 # ~/. Profile: executed by the command interpreter for the login shells.
2 # This file is not read by bash (1), the if ~/. Following the 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 the/etc/profile; For setting the umask
8 # for SSH logins, install and configure the libpam - umask package. The
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 the PATH so it includes the user 's private bin if it exists
20 if [-d "$HOME/bin"]. Then
21 PATH="$HOME/bin: $PATH"
22 fi
23
24 # set the PATH so it includes the user 's private bin if it exists
25 if [-d "$HOME/local/bin"]. Then
26 PATH=". $HOME/local/bin: $PATH "
27 fi

CodePudding user response:

reference redumbable reply: 3/f
the PATH of the variable is actually boot automatically set, if you want to temporarily change its value only need the command line
PATH='... 'set directly,
If you want to make a permanent change its value, need to modify some files, but also points the user, if it is used for the user to change, you need to use the root user to modify/etc/profile or/etc/bashrc (these two files, only need to modify a different distribution file name may be slightly different),
If want to change is only for the current user, then modify the user home directory. The profile or the bashrc file,
As to how to modify, according to the need to decide on their own, such as to make the PATH of a certain field is not appear, you can try to find the above four file where to add this field, to save the field is deleted, the file will not take effect immediately after the modification of preservation, but after the next system restart, can come into effect, if is to add fields to the PATH, will be the source command to make it effective immediately,
only. In the four files in the profile PATH, but I don't know how to change, is to put the line to delete it, 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 the PATH so it includes the user 's private bin if it exists
20 if [-d "$HOME/bin"]. Then
21 PATH="$HOME/bin: $PATH"
22 fi
23
24 # set the PATH so it includes the user 's private bin if it exists
25 if [-d "$HOME/local/bin"]. Then
26 PATH=". $HOME/local/bin: $PATH "
27 fi
I want to had deleted line 26 this path
  • Related