What is the purpose of the export command in Linux?
The export command in Linux is used to set environment variables. When we run a command in the terminal, the system searches for environment variables to determine the location of the command to be executed. The export command can set a variable as an environment variable, allowing access to that variable in the current session or child processes. The format of this command is:
Set the value of a variable to a specific value for export.
“Here, VARIABLE_NAME refers to the name of the environment variable to be set, while VALUE represents the value to be assigned.”
Environment variables set with the export command can be used in the current session and can also be used in starting new terminal sessions or sub-processes.