Skip to content

cd

Change the current working directory.

cd
cd(dir)
cd dir

Without an argument, prints the current working directory. With a path string, changes to that directory. Subsequent relative file references resolve from the new working directory.

Like a Unix shell command, cd accepts the unparenthesized form cd somepath in addition to the function-call form cd('somepath').

cd % print current directory
cd('data/raw')
cd .. % parent directory
  • pwd — Print the current working directory.
  • dir — List files in a directory.
  • mkdir — Create a directory.
  • home — Move the cursor to the top of the command window.