Setting and viewing Methods for "Go" Linux environment variables

Source: Internet
Author: User
1. Use the ENV command to display all environment variables $ env hostname=redbooks.safe.org pvm_rsh=/usr/bin/rsh Shell=/bin/bash term=xterm histsize=1000. .. 2. Use the SET command to display all locally defined shell variables $ set3. Use the unset command to clear the environment variable set to set the value of an environment variable. Clear the value of the environment variable with the unset command. If no value is specified, the value of the variable is set to NULL.  Examples are as follows: $ export test= "test ..." #增加一个环境变量TEST $ env|grep Test #此命令有输入, proving that the environment variable test already exists test=test ... $ unset $TEST #删除环境变量TEST $ env|grep Test #此命令没有输出, proving that the environment variable test already exists 4. Use the echo command to view a single environment variable. For example: Echo $PATH 5. Common environment variables PATH determines which directories the shell will look for commands or programs home current user home directory histsize history number LOGNAME Current user's login HOSTNAME refers to the name of the host SH ELL The current user shell type Languge language-related environment variables, multiple languages can modify this environment variable mail current user's message storage directory PS1 basic prompt, for the root user is #, for ordinary users is $6.  Set a new environment variable HELLO $ export hello= "hello!" $ echo $HELLO hello!

Setting and viewing Methods for "Go" Linux environment variables

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.