See
BLT.
relative path: See
path,
pathname,
absolute path.
A relative path is the path from the current directory (see
pwd) to some other directory.
Example:
Suppose you want to specify a file "testfile.txt" in directory "user01" of directory "home".
The absolute path is:
/home/user01/testfile.txt
Some relative paths:
- If the pwd is /home, the relative path is
user01/testfile.txt.
- If the pwd is /home/user02, the relative path is
../user01/testfile.txt. (Note that .. denotes the parent of the current directory.)
Note that the ability to specify a relative path using ".." is dangerous under some circumstances, and some programs disable the ability to follow a path containing "..".
For example, if you were in a
chroot jail at /home/user01, and executed a cd to ../../ you would be in the root directory.
Also related to security, it is recommended that you not place "." on your path. Thus you typically need to execute a command in the current directory by issuing it as
./<command> rather than just
<command>. (If you put . on your path, a cracker could put an executable file in your home directory with the same name as some command (like ls) -- when you invoke the ls command, his program is run instead of the system ls command. (Do I have this last a little mixed up? Are there two (slightly different) dangers, one from putting . on the path and another from putting, for example, your home directory on the path?)
Contributors
- RandyKramer - 29 Jan 2002
- <If you edit this page, add your name here, move this to the next line>