Escolar Documentos
Profissional Documentos
Cultura Documentos
Shell
DOS
Root Directory
Directory
Separator
/
/ or \
[drive
(note:
letter:]\ or command.co
m
COMMAND.COM \\[server
does not treat
name]\
/ as a
[volume]\
directory
separator)
Current
Directory
.
Parent
Directory
..
..
Home
Directory
~
/ho
./i
../
~/.
C:\
A:P
\\S
XT
C:\
OS/2
cmd.exe
Microsoft cmd.exe
Windows
[drive
letter:]\
\ (relative
to %CD%)
or [drive_le
tter]:\
or \\
[server]\
[sharename]
\
or \\?\
[drive_spec
/ or \
..
/ or \
..
A:P
C:\
/us
C:L
\\S
xt
\\?
tte
\\?
C:\
ern
Microsoft Windows
Windows PowerShell
]:\
or \\?\
[server]\
[sharename]
\
or \\?\UNC\
[server]\
[sharename]
\
or \\.\
[physical_d
evice]\
./i
../
[drive
name:]/ or [
drive
name:]\ or
\\[server
name]\ or
C:\
\\S
xt
cd
[PSSnapIn
name]\
[PSProvider
name:]
[:PSDrive
root]
TOPS-20
DCL
[device
name:]
RSX-11
MCR
[device
name:]
OpenVMS DCL
[device
name:]
[000000] or
[NODE["acco
untname
password"]]
::[device
name]
/ or \
..
Use
Var
Reg
SOF
Mic
\Ce
PS:
DR0
.
[]
[-]
SYS$LOGI SYS
N:
[US
[]I
[-.
SYS
[.D
GEI
Classic Mac
OS
ProDOS
AmigaOS
AppleSoft BASIC
Amiga CLI /
AmigaShell
[000000]:
SYS
[volume or
drive
name]:
Mac
:fi
::f
:::
/[volume
or drive
name]/
[drive,
volume,
device or
assign
name]:
::
/
SCH
ORT
FLI
"" (empty
string)
Wor
DF0
S:S
TCP
[fs
type[#optio
n]:][:drive
number or
disc name.]
$
note: &, % and @
can also be used
to reference the
root of the current
user, the library
and the current
(working)
directory
respectively.
Domain/OS Shell
//
MenuetOS CMD
RISC OS
Task window
%
VOS command-line [system_nam
Stratus VOS
interpreter
e]#[module
_name]>
&
ADF
$.D
Net
$.M
Lan
$.P
NFS
ADF
@.i
^.^
Whe
are m
as in
>
\us
<
%sy
erD
\NO
NonStop
Kernel
CP/M
TACL Tandem
Advanced
Command
Language
No root
CCP
[drive
letter:]
No parent
directory
\NO
\NO
$DE
no
no
no
A:L
no parent
subdirectories subdirectories
subdirectories
Japanese and Korean versions of Windows may often display the '' character
or the '' character instead of the directory separator. In such cases the code
for a backslash is being drawn as these characters. Very early versions of MSDOS replaced the backslash with these glyphs on the display to make it
possible to display them by programs that only understood 7-bit ASCII (other
characters such as the square brackets were replaced as well, see ISO
646, Windows Codepage 932 (Japanese Shift JIS), and Codepage 949
(Korean)). Although even the first version of Windows supported the 8bit ISO-8859-1 character set which has the Yen sign at U+00A5, and modern
versions of Windows supports Unicode which has the Won sign at U+20A9,
much software will continue to display backslashes found in ASCII files this
way to preserve backwards compatibility.[1]
Mac OS X, as a derivative of UNIX, uses UNIX paths internally. However, to
preserve compatibility for software and familiarity for users, many portions of
the GUI switch "/" typed by the user to ":" internally, and switch them back
when displaying filenames (a ":" entered by the user is also changed into "/"
but the inverse translation does not happen).
Uniform Naming Convention[edit]
The Microsoft Windows UNC, short for Universal Naming
Convention or Uniform Naming Convention, specifies a common syntax
to describe the location of a network resource, such as a shared file,
directory, or printer. The UNC syntax for Windows systems has the generic
form:
\\ComputerName\SharedFolder\Resource
Microsoft often refers to this as a "network path".
Some Microsoft Windows interfaces also allow or require UNC syntax
for WebDAV share access, rather than a URL. The UNC syntax is
extended[2]with optional components to denote use of SSL and TCP/IP port
as \\?\C:\File or \\?\UNC\Server\Volume\File
In versions of Windows prior to Windows XP, only the APIs that accept "Long
UNC" could accept more than 260 characters.
The shell in Windows XP and Windows Vista, explorer.exe, allows path names
up to 248 characters long.[citation needed]
Since UNCs start with two backslashes, and the backslash is also used for
string escaping and in regular expressions, this can result in extreme cases
of leaning toothpick syndrome: an escaped string for a regular expression
matching a UNC begins with 8 backslashes \\\\\\\\ because the string
and regular expression both require escaping. This can be simplified by
using raw strings, as in C#'s @"\\\\" or Python's r'\\\\' .
POSIX pathname definition[edit]
Most Unix-like systems use a similar syntax.[3] POSIX allows treating a path
beginning with two slashes in an implementation-defined manner,[4]though
in other cases systems must treat multiple slashes as single slashes. [5] Many
applications on Unix-like systems (for example, scp, rcp and rsync) use
resource definitions such as:
hostname:/directorypath/resource
or like URLs with the service name (here 'smb'):
smb://hostname/directorypath/resource
Example[edit]
Unix style[edit]
The following worked example discusses the behavior of a Unix-style file
system as it would appear from a terminal or terminal application (commandline window):
Attached to a current working directory (cwd) of:
/users/mark/
One wants to change the current working directory to:
/users/mark/bobapples
At that moment, the relative path for the desired directory can be
represented as:
./bobapples
or for short:
bobapples
and the absolute path for the directory as:
/users/mark/bobapples
Given bobapples as the relative path for the directory wanted, the following
may be typed at the command prompt to change the current working
directory to bobapples:
cd bobapples
Two dots ("..") point upwards in the hierarchy, to indicate the parent
directory; one dot (".") represents the current directory itself. Both can be
components of a complex relative path (e.g., "../mark/./bobapples"),
where "." alone or as the first component of such a relative path represents
the working directory. (Using "./foo" to refer to a file "foo" in the current
working directory can sometimes usefully distinguish it from a resource "foo"
to be found in a default directory or by other means; for example, to view a
specific version of a manual page instead of the one installed in the system.)
MS-DOS/Microsoft Windows style[edit]
Contrary to popular belief, the Windows system API accepts slash, and thus
all the above Unix examples should work. But many applications on Windows
interpret a slash for other purposes or treat it as an invalid character, and
thus require you to enter backslash notably the cmd.exe shell (often called
the "terminal" as it typically runs in a terminal window). Note that many
other shells available for Windows, such as tcshand Windows PowerShell,
allow the slash.
In addition "\" does not indicate a single root, but instead the root of the
"current disk". Indicating a file on a disk other than the current one requires
prefixing a drive letter and colon. No ambiguity ensues, because colon is not
a valid character in an MS-DOS filename, and thus one cannot have a file
called "A:" in the current directory.
UNC names (any path starting with \\?\) do not support slashes.[6]
The following examples show MS-DOS/Windows-style paths, with backslashes
used to match the most common syntax:
A:\Temp\File.txt
This path points to a file with the name File.txt, located in the
directory Temp, which in turn is located in the root directory of the drive A:.
C:..\File.txt
This path refers to a file called File.txt located in the parent directory of
the current directory on drive C:.
Folder\SubFolder\File.txt
This path denotes a file called File.txt located in SubFolder directory
which in turn is located in Folder directory which is located in the current
directory of the current drive (since this example gives no drivespecification).
File.txt
This rather simple path points to a file named File.txt located in the
current directory (since the path lacks a directory-specification) on the
current drive (since no drive specification is present).
\\.\COM1
This path refers to the first serial port (COM1).
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
...
This example uses a path containing slashes as directory separator. The
command redirects the content of the file to the more command.
E:\>dir "/Folder/SubFolder/" /Q
Volume in drive E is Data
Volume Serial Number is 07BE-0B10
Directory of E:\Folder\SubFolder
18 October 2008 08:15
18 October 2008 08:15
18 October 2008 08:15
1 File(s)
2 Dir(s)
AM <DIR> DOMAIN\user .
AM <DIR> DOMAIN\user ..
AM <DIR> DOMAIN\user File.txt
8 bytes
19,063,000 bytes free
Dirname
Distributed file system (DFS)
Filename
Filesystem Hierarchy Standard (FHS)
Fully qualified file name
PATH (variable)
Uniform Resource Locator (URL)
References[edit]
This article is based on material taken from the Free On-line Dictionary of
Computing prior to 1 November 2008 and incorporated under the
"relicensing" terms of the GFDL, version 1.3 or later.
1.
2.
3.
4.
5.
6.
Jump
Jump
Jump
Jump
Jump
Jump
up^
up^
up^
up^
up^
up^
External links[edit]
Path Definition - The Linux Information Project (LINFO)
Naming Files, Paths, and Namespaces - Microsoft Developer Network (MSDN)
Categories:
Computer file systems