We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
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.

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>
Topic revision: r1 - 30 Jan 2002 - 03:00:04 - RandyKramer
 
TWIKI.NET
Copyright © 1999-2008 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
See TWiki's New Look