z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Removing a directory

z/OS UNIX System Services User's Guide
SA23-2279-00

You can remove an empty directory (one with no files or subdirectories) from the file system with the rmdir command. The format of the command is:
rmdir directory
To remove your working directory, you must first move into another working directory.
To delete the files in a directory and the directory itself in one step, use the rm command with the -r option. The format of the command is:
rm -r file
where file is the name of the directory. Be careful! You may want to use the -i option so that you will be prompted to confirm the deletions:
rm -ri file

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014