Learn linux from scratch (1)

Source: Internet
Author: User
Learn linux from the beginning (1)-Linux general technology-Linux technology and application information. The following is a detailed description. Author: z-x-wing
Linux beginners may encounter export commands and are confused from time to time. In fact, export is used to create/define environment variables.

For example, enter:
Export Hello = "hello" (do not quote it)

In this way, an environment variable named Hello is defined, and its value is hello.

When you enter:
Echo $ Hello, the following output is displayed:
Hello

So someone may ask, what is an environmental variable?
Linux is a multi-user system. Each user has its own running environment, and the running environment is defined as a set of environment variables. An environment variable is an object with a specific name. It contains information that one or more applications will use. Common environment variables in linux are as follows:

PATH: determines the directories to which shell will look for commands or programs.
HOME: HOME Directory of the current user
MAIL: refers to the MAIL storage directory of the current user.
SHELL: The Shell used by the current user.
HISTSIZE: the number of records that save historical commands.
LOGNAME: The Login Name of the current user.
HOSTNAME: indicates the host name. If a host name is used by many applications, it is usually obtained from this environment variable.
LANG/LANGUGE: it is a language-related environment variable. Users in multiple languages can modify this environment variable.

Common Environment Variable commands for bash-sh:
1. echo shows the value of an environment variable, for example, echo $ PATH.
2. Set a new environment variable for export, for example, export HELLO = "hello" (no quotation marks are allowed)
3. env display all environment variables
4. set: Display locally defined shell Variables
5. unset clear environment variables such as: unset HELLO
6. readonly: readonly HELLO

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.