---
name: "cd"
section: "n"
platform: "linux"
package: "tcl"
version: "8.6.16-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/cd/n"
---

# cd(n)

Change working directory

```

```

## NAME

cd - Change working directory

## SYNOPSIS

**cd** ?*dirName*?

```

```

## 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 (in a threaded environment) all threads.

## EXAMPLES

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

```
cd ~fred
```

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

```
cd ../lib
```

## SEE ALSO

[filename(n)](/filename/n.md), [glob(n)](/glob/n.md), [pwd(n)](/pwd/n.md)

## KEYWORDS

working directory
