116k views
1 vote
What command is used to set an environment variable?

1 Answer

1 vote

Final answer:

The command used to set an environment variable varies depending on the operating system you are using. In Linux and macOS, the command is 'export VARIABLE_NAME=value'. In Windows,

Step-by-step explanation:

The command used to set an environment variable varies depending on the operating system you are using.

In Linux and macOS, the command is:

export VARIABLE_NAME=value

In Windows, the command is:

set VARIABLE_NAME=value

For example, if you wanted to set the variable 'USERNAME' to 'John' in Linux, you would use the command 'export USERNAME=John'. In Windows, the command would be 'set USERNAME=John'.

User Mdb
by
9.0k points