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...
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:
- Changing directory with relative path concept : $pwd /home/kt $cd abc $pwd /home/kt/abc.
- Changing directory with absolute path concept: $pwd /home/kt $cd /home/kt/abc $pwd /home/kt/abc.
7 февр. 2018 г.
Must Read
How do I create a path in Linux?
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. export PATH=/usr/java//bin:$PATH.
- Save the file and exit. Use the source command to force Linux to reload the .