Change Directory (cd)

Change (working) directory

Description

Changes current working directory.

Usage

cd [path]

Examples

Home directory

» cd ~

Running cd without a parameter will also change to the current user’s home directory:

» cd

Previous directory

» cd -

Absolute path

» cd /etc/

Relative path

» cd Documents
» cd ./Documents

Detail

$PWDHIST

cd updates an environmental variable, $PWDHIST with an array of paths. You can then use that to change to a previous directory.

View the working directory history

» $PWDHIST

Change to a previous directory

» cd $PWDHIST[-1]

cd - is syntactic sugar for $PWDHIST[-1]

auto-cd

Some people prefer to omit cd and just write the path, with their shell automatically changing to that directory if the “command” is just a directory. In Murex you can enable this behaviour by turning on “auto-cd”:

config set shell auto-cd true

See Also


This document was generated from builtins/core/management/functions_doc.yaml.

This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.

Last built on Tue Dec 10 22:56:57 UTC 2024 against commit 60f05a260f05a227caf73dd5b3478e3cb3f4bb24e46745b.

Current version is 6.4.1005 (develop) which has been verified against tests cases.