cd(n) Tcl Built-In Commands cd(n)

```

```

# [NAME](#NAME)

cd - Change working directory

# [SYNOPSIS](#SYNOPSIS)

**cd** ?*dirName*?

```

```

# [DESCRIPTION](#DESCRIPTION)

Change the current working directory to *dirName*, or to the home directory (as specified in the HOME environment variable) if *dirName* is not given. Returns an empty string.

Note that the current working directory is a per-process resource; the **cd** command changes the working directory for all interpreters and all threads.

# [EXAMPLES](#EXAMPLES)

Change to the home directory of the user **fred**:

```
cd [file home fred]
```

Change to the directory **lib** that is a sibling directory of the current one:

```
cd ../lib
```

# [SEE ALSO](#SEE_ALSO)

[filename(n)](/man/os/tcl/filename.n), [glob(n)](/man/os/tcl/glob.n), [pwd(n)](/man/os/tcl/pwd.n)

# [KEYWORDS](#KEYWORDS)

working directory

Tcl

---

Document: cd(n) from tcl 9.1.0-r1 (Chainguard OS)
Source: https://downloads.sourceforge.net/project/tcl/Tcl/9.1.0/tcl9.1.0-src.tar.gz
