O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Removing Files

Use the rm command to remove (delete) one or more files, for example:

rm acme doc/report7 /data/acme

The rm command cannot remove directories:

$ rm /tmp
rm: /tmp: is a directory
$

Previously, the text discussed confirmation requests for rm and mv. If you want to prevent getting a confirmation request when you delete another user’s file that you don’t have permission to modify, use the rm -f option to force the removal without asking for confirmation. This is useful when you are deleting a group of files belonging to several users that you are sure you want to delete. This option will also suppress any error message if the file does not exist.

If you are deleting a group of files, you can use the rm -i option to display each filename ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required