create new tag
, view all tags
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.


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?)


  • RandyKramer - 29 Jan 2002
  • <If you edit this page, add your name here, move this to the next line>
Topic revision: r1 - 2002-01-30 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look