rm, rmdir - Remove files or directories


rm file
rmdir [ -p ] [ -s ] dir


Rm removes the entries for one or more files from a directory. Removal of a file requires “destroy” permission in its directory, but neither read nor write permission on the file itself.

If a designated file is a directory, it can only be deleted by rm if it is empty.

Rmdir removes entries for the named directories, including all files and subdirectories within the directory itself. If the -p option is given, the name of each file removed is printed first. If the -s option is given, the named directory is purged, but the directory entry itself is retained.

See Also