How Do You Create a Relative Path in Linux?
Contents
Command Description Path
cp ./dir1/abc . Copy the file abc in current directory Use relative path.
./simple.sh Run script from current directory Use relative path

How do you set a relative path in Linux?

Let’s see both the absolute and relative path concepts to do this:

  1. Changing directory with relative path concept : $pwd /home/kt $cd abc $pwd /home/kt/abc.
  2. Changing directory with absolute path concept: $pwd /home/kt $cd /home/kt/abc $pwd /home/kt/abc.

7 февр. 2018 г.

How do I create a path in Linux?

To Set PATH on Linux

  1. Change to your home directory. cd $HOME.
  2. Open the . bashrc file.
  3. Add the following line to the file. Replace the JDK directory with the name of your java installation directory. export PATH=/usr/java//bin:$PATH.
  4. Save the file and exit. Use the source command to force Linux to reload the .
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest