| 1 |
'\" |
| 2 |
'\" Copyright (c) 1993 The Regents of the University of California. |
| 3 |
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 4 |
'\" |
| 5 |
'\" See the file "license.terms" for information on usage and redistribution |
| 6 |
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 7 |
'\" |
| 8 |
.TH cd n "" Tcl "Tcl Built-In Commands" |
| 9 |
.so man.macros |
| 10 |
.BS |
| 11 |
'\" Note: do not modify the .SH NAME line immediately below! |
| 12 |
.SH NAME |
| 13 |
cd \- Change working directory |
| 14 |
.SH SYNOPSIS |
| 15 |
\fBcd \fR?\fIdirName\fR? |
| 16 |
.BE |
| 17 |
.SH DESCRIPTION |
| 18 |
.PP |
| 19 |
Change the current working directory to \fIdirName\fR, or to the |
| 20 |
home directory (as specified in the HOME environment variable) if |
| 21 |
\fIdirName\fR is not given. |
| 22 |
Returns an empty string. |
| 23 |
Note that the current working directory is a per-process resource; the |
| 24 |
\fBcd\fR command changes the working directory for all interpreters |
| 25 |
and (in a threaded environment) all threads. |
| 26 |
.SH EXAMPLES |
| 27 |
.PP |
| 28 |
Change to the home directory of the user \fBfred\fR: |
| 29 |
.PP |
| 30 |
.CS |
| 31 |
\fBcd\fR ~fred |
| 32 |
.CE |
| 33 |
.PP |
| 34 |
Change to the directory \fBlib\fR that is a sibling directory of the |
| 35 |
current one: |
| 36 |
.PP |
| 37 |
.CS |
| 38 |
\fBcd\fR ../lib |
| 39 |
.CE |
| 40 |
.SH "SEE ALSO" |
| 41 |
filename(n), glob(n), pwd(n) |
| 42 |
.SH KEYWORDS |
| 43 |
working directory |