cd

Linux · Directories · available in the simulator

What it does

Changes the current directory.

Syntax

cd [-L | -P] [directorio]

Options and parameters

  • ..

    Moves up one directory.

  • ~

    Changes to the user's home directory.

    cd ~
  • -

    Returns to the previous working directory.

    cd -
  • -L

    Follows the logical path without resolving symbolic links.

  • -P

    Resolves symbolic links and uses the physical directory structure.

Usage examples

  • cd ..
  • cd /etc/network
  • cd ~
  • cd -
  • cd /var/log

Notes and common mistakes

  • cd is a shell builtin, not an external program.
Practise cd

Related commands