Question: How to Set Path in Linux?
Contents to Set Path on Linux Change to Your Home Directory. Cd $Home. Open The. Bashrc File. Add the Following Line to the File. Replace the Jdk Directory...
Contents
To Set PATH on Linux
- Change to your home directory. cd $HOME.
- Open the .bashrc file.
- Add the following line to the file. Replace the JDK directory with the name of your java installation directory.
- Save the file and exit. Use the source command to force Linux to reload the .bashrc file which normally is read only when you log in each time.
How do I change path in Linux?
How to Change the Path Variable in Linux
- Find the current path by typing “echo $PATH” at the bash shell prompt.
- Temporarily add the :/sbin and :/usr/sbin paths to the current path list by typing the following command at the bash shell prompt:
- Echo the contents of PATH to confirm the changes are reflected in the variable.
Must Read
What is the path variable in Linux?
PATH is an environmental variable in Linux and other Unix-like operating systems that tells the shell which directories to search for executable files (i.e., ready-to-run programs) in response to commands issued by a user.