[go: up one dir, main page]

Menu

[267579]: / man / en_US / cd.tea  Maximize  Restore  History

Download this file

98 lines (72 with data), 3.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
# Dos9 Manual pages, The Dos9 project
# Copyright (C) 2012-2014 Romain Garbi (DarkBatcher)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{{CD, CHDIR commands and %CD% Variable}}
The {CD} command changes or shows the current directory of {dos9|Dos9}
command prompt.
The {%CD%} variable expands to the current directory of {dos9|Dos9}
command prompt.
{{Synopsis}}
${CD [[/d] path]
CHDIR [[/d] path]}
Changes or displays the current working working directory.
- {path} : A path to the new working directory.
- {/d} : Forces changing current drive on {Windows}. This switch
has no effect on {UNIX}-like platforms since their file system
trees always share a unique root {/}.
If neither {path} nor {/d} is specified, then {CD} will display
the path to the current working directory.
On {Windows} (since version {2014.0.9b}), the {CD} command behaves
allmost the same way as {cmd}'s {CD} does, supporting the
possibility to have several current working directories depending
on the {current drive}. The {CD} command behaviour is the following :
- If {path} only consists of a drive letter (ie. something like "A:"),
then {CD} enables the drive referred to by {path} and use the
current working directory associated with this drive. Such a drive
change be abbreviated by just typing {X:} at the prompt.
- If {path} is absolute (ie. It mentions the drive letter plus
sub directories), then, the current working directory associated
with the drive is replaced by {path}. If {/d} is not specified,
the {CD} command will not modify current directory, unless {path}
refers to the current drive.
- If {path} is relative, then {CD} changes the current working
directory to {path}. This is the only syntax of {CD} that is
guaranteed to be portable across platforms.
{{Variables}}
${%CD%}
Expands to the current working directory. This variable is read-only
and can not be modified using {set|SET}. Depending on {dos9|Dos9}
version, the undocumented {%__CD__%} variable defined by {cmd}
might as well be defined by {dos9}, however its use is strongly
discouraged.
${%=X:%}
Expands to the current working directory associated with drive {X:}.
This undocumented variables are also defined by {cmd.exe}, even
though they are undocumented. However, this family of variable is
not defined on {UNIX}-like OSes.
{{Bogus}}
On {Windows}, {CD} may actually change current directory to a path
that does not exist if {path} is made of dots. Indeed, internal
windows routines fail to identify such folders as non-existing, thus
allowing {Dos9} to change directory. For example:
${CD ...}
{{Compatibility}}
Fully compatible with {cmd.exe}.
Available since version {0.4}
{{See also}}
{spec/var|Variable}, {spec/index|Specifications Index},
{commands|Command list}