Home » mariadb on ubuntu » UNIX/LINUX Command – rm

UNIX/LINUX Command – rm


rm—Remove files


rm [-dfirvR] [–directory] [–force] [–interactive] [–recursive] [–help] [–version] [–verbose] name…


This manual page documents the GNU version of rm. rm removes each specified file. By default, it does not remove directories. If a file is unwritable, the standard input is a tty, and the -f or –force option is not given, rm prompts the user for whether to remove the file. If the response does not begin with y or Y, the file is skipped.

GNU rm, like every program that uses the getopt function to parse its arguments, lets you use the — option to indicate that all following arguments are nonoptions. To remove a file called -f in the current directory, you could type either
rm — -f
rm ./-f

The UNIX rm program’s use of a single – for this purpose predates the development of the getopt standard syntax.


Options Description
-d, –directory Remove directories with unlink instead of rmdir, and don’t require a directory to be empty before trying to unlink it. Only works for the superuser. Because unlinking a directory causes any files in the deleted directory to become unreferenced, it is wise to fsck the filesystem after doing this.
-f, –force Ignore nonexistent files and never prompt the user.
-i, –interactive Prompt whether to remove each file. If the response does not begin with y or Y, the file is skipped.
-r, -R, –recursive Remove the contents of directories recursively.
-v, –verbose Print the name of each file before removing it.
–help Print a usage message on standard output and exit successfully.
–version Print version information on standard output, then exit successfully.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

UNIX/LINUX Command – uuencode

UNIX/LINUX Command – uuencode

NAME uuencode—Encode a binary fileuudecode—Decode a file created by uuencode SYNOPSIS uuencode [-m] [ file ] nameuudecode [-o outfile] [ file ]… DESCRIPTION uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other...

Follow Us

Our Communities

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!



Submit a Comment

Your email address will not be published. Required fields are marked *

four × two =