File Management Commands
Prev | Chapter 16. BeanShell Commands | Next

## File Management Commands

- `void cd(` | String dirname`)`;

  Changes the working directory of the BeanShell interpreter to `dirname`.

- `void cp(` | String fromFile,
  | String toFile`)`;

  Copy `fromFile` to `toFile`.

- `void dir(` | String dirname`)`;

  Displays the contents of directory `dirname`. The format of the display is similar to the Unix `ls -l` command.

- `void mv(` | String fromFile,
  | String toFile`)`;

  Moves the file named by `fromFile` to `toFile`.

- `File pathToFile(` | String filename`)`;

  Create a `File` object corresponding to `filename`. Relative paths are resolved with reference to the BeanShell interpreter's working directory.

- `void pwd(` | `void)`; |

  Writes the current working directory of the BeanShell interpreter to the output stream of the current process.

- `void rm(` | String pathname`)`;

  Deletes the file name by `pathname`.

Prev | Up | Next
Output Commands | Home | Component Commands