How to view and add path environment variables under Linux

Source: Internet
Author: User
Tags mail ssh

$PATH: determines which directories the shell will look for commands or programs, and the PATH value is a series of directories that Linux searches for and compiles links to when you run a program.

Edit your PATH declaration in the form of:

Path= $PATH: <path 1>:<path 2>:<path 3>:------: <path n>

You can add the specified path yourself, separated by a colon in the middle. When the environment variable is changed, it will take effect the next time the user logs on, and if you want to take effect immediately, you can execute the following statement: $ source. bash_profile

It should be noted that it is best not to put the current path "./" Into the path, which may be subject to unexpected attacks. When you are done, you can view the current search path through the $ echo $PATH. With this customization, you can avoid frequent startup of programs located outside the path of the shell search.

Use the Export command to view the path value

[Root@localhost u-boot-sh4]# Export

Declare-x cvs_rsh= "SSH"

Declare-x display= ": 0.0"

Declare-x g_broken_filenames= "1"

Declare-x histsize= "1000"

Declare-x home= "/root"

Declare-x hostname= "localhost"

Declare-x inputrc= "/ETC/INPUTRC"

Declare-x lang= "ZH_CN. UTF-8 "

Declare-x lessopen= "|/usr/bin/lesspipe.sh% s"

Declare-x logname= "Root"

Declare-x ls_colors= "NO=00:FI=00:DI=00;34:LN=00;36:PI=40;33:SO=00;35:BD=40;33;01:CD=40;33;01:OR=01;05; 37;41:mi= 01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh= 00;32:*.csh=00;32:*.tar= 00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00; 31:*. Z=00;31:*.GZ=00;31:*.BZ2=00;31:*.BZ=00;31:*.TZ=00;31:*.RPM=00;31:*.CPIO=00;31:*.JPG=00;35: *.gif=00;35:*.bmp=00 ; 35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: "

Declare-x mail= "/var/spool/mail/root"

Declare-x oldpwd= "/root"

Declare-xpath= "/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/ Bin:/root/bin "

Declare-x pwd= "/opt/stm/stlinux-2.3/devkit/sources/u-boot/u-boot-sh4"

Declare-x shell= "/bin/bash"

Declare-x shlvl= "1"

Declare-x ssh_askpass= "/usr/libexec/openssh/gnome-ssh-askpass"

Declare-x term= "Xterm"

Declare-x user= "Root"

Declare-x xauthority= "/root/.xauthkszh7b"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.