Working directories: pwd cd

### 5.6.1 Working directories: pwd cd

Xcas has a working directory where it stores files that it creates; typically this is the user’s home directory. The pwd command will tell you what the current working directory is, and and the cd command lets you change it.

- pwd takes no arguments.
- pwd() returns the name of the current working directory.

Example.
Input:

pwd()

Output: might be something like:

/home/username

- The cd command takes one argument:
  dirname, the name of a directory (a string).
- cd(dirname) changes the working directory to dirname.

Example.
If you enter:
Input:

cd("foo")

or (on a Unix system):
Input:

cd("/home/username/foo")

then the working directory will change to the directory foo, if it exists. Afterwards, any files that you save from Xcas will be in that directory.

To load or read a file, it will need to be in the working directory. Note that if you have the same file name in different directories, then loading the file name will load the file in the current directory.