rm, unlink

remove directory entries

rm [-dfiPRrvW] file\…
unlink file

Remove files

Caution rm * deletes all the files in the current directory.

-d remove directories and other types of files.
-f force i.e. without prompting for confirmation, ignoring of the file's permissions. does not exist, do not display a diagnostic message or modify the exit status to reflect an error. The overrides previous -i .
-i Interactively confirm removal of each file. Overrides previous -f
-P Purge securely Overwrite regular files with FF, then 00, and then FF Fgain, before they are deleted.
-R
-r
Recursively remove the file hierarchy rooted in each file argument. implies -d . With -i , the user must confirm each directory's contents and directory
-v Be verbose when deleting files, showing them as they are removed.
-W undelete the named files. only be used to recover files covered by whiteouts in a unionFS
The rm utility removes symbolic links, not the files referenced.

Current and parrent directoy cannot be removed by specifing . or .. .

As unlink, accepts only one non-directory argument and options.

Exits 0 if all of the named files or file hierarchies were removed, or with -f and all of the existing files or file hierarchies were removed.

If the permissions do not permit writing, and the STDIN is a terminal, the user is prompted ,on the STDERR, for confirmation.

Accepts the -- to stop option list and allows the removal of names begining with (`-'). For Example:

           rm -- -filename>
Or by using a path reference. For example:
 rm /home/user/-filename
 rm ./-filename
SEE rmdir(1), undelete(2), unlink(2), fts(3), getopt(3), symlink(7) The rm command is almost IEEE Std 1003.2 ("POSIX.2") compatible, except that POSIX requires rm to act like rmdir(1) when the file specified is a directory. This implementation requires the -d option if such behavior is desired. This follows the historical behavior of rm with respect to directories.