Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Path (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== ===Unix=== The following examples are for typical, Unix-based file systems: Given the working directory is {{code|/home/mark/}} and it contains subdirectory {{code|bobapples}}, relative paths to the subdirectory include {{code|./bobapples}} and {{code|bobapples}}, and the absolute path is {{code|/home/mark/bobapples}}. A command to change the working directory to the subdirectory: <syntaxhighlight lang="console> $ cd bobapples </syntaxhighlight> If the working directory was {{code|/home/jo}}, then the relative path {{code|../mark/bobapples}} specifies the subdirectory. The double dots {{code|..}} indicates a move up the directory hierarchy one level to {{code|/home}}, the rest indicates moving down to {{code|mark}} and then {{code|boapples}}. ===Microsoft shells=== {{More citations needed section|date=November 2020}} [[File:Dir command in Windows Command Prompt.png|thumb|300px|Screenshot of a [[Microsoft Windows|Windows]] [[Command Prompt]] shell showing filenames in a directory]] <!--Contrary to popular belief, --> The [[Windows API]] accepts slash for path delimiter. Unlike Unix that always has a single root directory, a Windows file system has a root for each storage drive. An absolute path includes a drive letter or uses the UNC format. A UNC path (starting with {{code|\\?\}}) does not support slashes.<ref name="w32paths" /> <code>A:\Temp\File.txt</code> is an absolute path that specifies a file named {{code|File.txt}} in the directory {{code|Temp}} which is in the root of drive {{code|A:}}: <code>C:..\File.txt</code> is a relative path that specifies file {{code|File.txt}} located in the parent of the working directory on drive {{code|C:}}: <code>Folder\SubFolder\File.txt</code> is a relative path that specifies file {{code|File.txt}} in directory {{code|SubFolder}} which is in directory {{code|Folder}} which is in the working directory of the current drive: <code>File.txt</code> is a relative path that specifies <code>File.txt</code> in the working directory: <code>\\.\COM1</code> specifies the first [[serial port]], [[COM (hardware interface)|COM1]]: The following uses a path with slashes for directory delimiter: <syntaxhighlight lang="doscon"> C:\>more < C:/Windows/system.ini ; for 16-bit app support [386Enh] woafont=dosapp.fon EGA80WOA.FON=EGA80WOA.FON EGA40WOA.FON=EGA40WOA.FON CGA80WOA.FON=CGA80WOA.FON CGA40WOA.FON=CGA40WOA.FON ... </syntaxhighlight> A path with forward slashes may need to be surrounded by double quotes to disambiguate from command-line switches. For example, {{code|dir /windows}} is invalid, but {{code|dir "/window"}} is valid. And {{code|cd}} is more lenient by allowing {{code|cd /windows}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)