search
HomeSystem TutorialLINUXThere are three types of variable classifications of environment variables in Shell.

Unixshell variable classification

There are three types of variables in the Shell: internal variables, environment variables, and user variables.

Internal variables: provided by the system, no need to define linux modification of user environment variablesGetting started with linux, cannot be changed

Environment variables: The system provides linux to modify user environment variables. You don’t need to define Linux software. You can change it. You can use export to convert user variables into environment variables.

User variables: user-defined, can be changed

(1) Internal variables (system variables, environment variables, parameter variables, predefined variables)

Internal variables are a special type of variables provided by Linux. These variables are used to make decisions in the program. The value of such variables cannot be changed within the shell program.

Description of representation

$n$1 represents the first parameter, $2 represents the second parameter...

$#Number of command line parameters

$0The name of the current program

修改环境变量linux_linux修改用户环境变量_linux修改环境变量的值

$?The return code of the previous command or function

$*Save all parameters in the "Parameter 1 Parameter 2..." mode

$@Save all parameters in the form of "Parameter 1" "Parameter 2"...

$$The (process ID number) PID of this program

(2)Environment variables

Linux environment (also known as shell environment) consists of many variables and the values ​​of these variables. The appearance of the environment is determined by the values ​​of these variables and variables. Such variables are environment variables.

修改环境变量linux_linux修改环境变量的值_linux修改用户环境变量

includes two parts, one is set by the system, mainly including: HOME, LOGNAME, MAIL, PATH, PS1, PWD, SHELL, TERM

Second, if the user sets it on the command line, use the export command, and the value will be lost when the user logs out

(3)User variables (private variables, local variables)

Set by yourself in the command line.

For more database and Linux technical content, please search "Chongqing Sizhuang"

linux修改环境变量的值_linux修改用户环境变量_修改环境变量linux

The above is the detailed content of There are three types of variable classifications of environment variables in Shell.. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:ITcool. If there is any infringement, please contact admin@php.cn delete
How does logging and auditing differ between Linux and Windows?How does logging and auditing differ between Linux and Windows?May 08, 2025 am 12:03 AM

Linuxoffersmoregranularcontroloverloggingandauditing,whileWindowsprovidesamorecentralizedsystem.1)Linuxusestoolslikesyslog,rsyslog,andjournaldforcustomizablelogging.2)WindowsusestheEventViewerforcentralizedlogmanagement.3)Linuxisidealforenvironmentsn

What is AI? A Beginner's Guide for Linux UsersWhat is AI? A Beginner's Guide for Linux UsersMay 07, 2025 am 11:23 AM

Artificial Intelligence (AI) is a term that’s been buzzing around for a while now, from self-driving cars to voice assistants like Siri and Alexa, AI is becoming a part of our everyday lives. But what exactly is AI, and why should Linux users care ab

50 Essential Linux Commands for Beginners and SysAdmins50 Essential Linux Commands for Beginners and SysAdminsMay 07, 2025 am 11:12 AM

For someone new to Linux, using it can still feel challenging, even with user-friendly distributions like Ubuntu and Mint. While these distributions simplify many tasks, some manual configuration is often required, but fully harnessing the power of L

How to Set Up Your Linux System for AI DevelopmentHow to Set Up Your Linux System for AI DevelopmentMay 07, 2025 am 10:55 AM

In the previous article, we introduced the basics of AI and how it fits into the world of Linux. Now, it’s time to dive deeper and set up your Linux system to start building your first AI model. Whether you’re a complete beginner or have some exper

How to Install Kloxo Web Hosting Control Panel in LinuxHow to Install Kloxo Web Hosting Control Panel in LinuxMay 07, 2025 am 10:52 AM

If you’re looking to manage your server with ease, Kloxo is a great option, as it is free and open-source web hosting control panel that allows you to manage your server and websites with a simple, user-friendly interface. In this guide, we’ll walk

How to Move Files and Folders with Spaces in LinuxHow to Move Files and Folders with Spaces in LinuxMay 07, 2025 am 10:17 AM

If you’ve ever found yourself in a situation where you’re trying to move a bunch of files and folders, only to be stumped by spaces in the folder names, you’re not alone. Spaces in filenames or folder names can quickly become a frustrat

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function