How Do I Add a Path in Linux?
Contents How Do You Add a File Path in Linux? Linux Open The. Bashrc File in Your Home Directory (For Example, /Home/Your-User-Name/. Bashrc ) in a Text...
Contents
How do you add a file path in Linux?
Linux
- Open the . bashrc file in your home directory (for example, /home/your-user-name/. bashrc ) in a text editor.
- Add export PATH=”your-dir:$PATH” to the last line of the file, where your-dir is the directory you want to add.
- Save the . bashrc file.
- Restart your terminal.
How do I permanently add a path in Linux?
To make the change permanent, enter the command PATH=$PATH:/opt/bin into your home directory’s . bashrc file. When you do this, you’re creating a new PATH variable by appending a directory to the current PATH variable, $PATH .