130 lines
3.7 KiB
HTML
130 lines
3.7 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content=
|
|
"text/html; charset=utf-8">
|
|
<title>rm - Remove directory entries</title>
|
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</HEAD>
|
|
<body bgcolor="#FFFFFF">
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
|
|
|
|
<h2>rm - Remove directory entries</h2>
|
|
|
|
<strong>Synopsis</strong>
|
|
|
|
<p><strong>rm [-f | -i] [-dPRr]</strong> <em>file</em> ...</p>
|
|
|
|
<p><strong>Description</strong></p>
|
|
|
|
<p>The <strong>rm</strong> utility attempts to remove the
|
|
non-directory type <em>files</em> specified on the command line. If
|
|
the permissions of the <em>file</em> do not permit writing, and the
|
|
standard input device is a terminal, the user is prompted (on
|
|
standard error) for confirmation.</p>
|
|
|
|
<p>The <strong>rm</strong> utility removes symbolic links, not the
|
|
files referenced by the links.</p>
|
|
|
|
<p>It is an error to attempt to remove the files "." and "..".</p>
|
|
|
|
<p><strong>Options</strong></p>
|
|
|
|
<dl>
|
|
<dt><strong>-d</strong></dt>
|
|
|
|
<dd>Attempt to remove directories as well as other types of
|
|
files.</dd>
|
|
|
|
<dt><strong>-f</strong></dt>
|
|
|
|
<dd>Attempt to remove the <em>files</em> without prompting for
|
|
confirmation, regardless of the file's permissions. If the file
|
|
does not exist, do not display a diagnostic message or modify the
|
|
exit status to reflect an error. The <strong>-f</strong> option
|
|
overrides any previous <strong>-i</strong> options.</dd>
|
|
|
|
<dt><strong>-i</strong></dt>
|
|
|
|
<dd>Request confirmation before attempting to remove each <em>
|
|
file</em>, regardless of the file's permissions, or whether
|
|
the standard input device is a terminal. If the response from the
|
|
standard input begins with the first character for the YES response
|
|
in the current locale, the <em>file</em> is removed. The <strong>
|
|
-i</strong> option overrides any previous <strong>-f</strong>
|
|
options.</dd>
|
|
|
|
<dt><strong>-P</strong></dt>
|
|
|
|
<dd>Overwrite regular files before deleting them. Files are
|
|
overwritten three times, first with the byte pattern 0xff, then
|
|
0x00, and then 0xff again, before they are deleted.</dd>
|
|
|
|
<dt><strong>-R</strong></dt>
|
|
|
|
<dd>Attempt to remove the file hierarchy rooted in each <em>
|
|
file</em> argument. The <strong>-R</strong> option implies the
|
|
<strong>-d</strong> option. If the <strong>-i</strong> option is
|
|
specified, the user is prompted for confirmation before each
|
|
directory's contents are processed (as well as before the attempt
|
|
is made to remove the directory). If the user does not respond
|
|
affirmatively, the file hierarchy rooted in that directory is
|
|
skipped.</dd>
|
|
|
|
<dt><strong>-r</strong></dt>
|
|
|
|
<dd>Equivalent to <strong>-R</strong>.</dd>
|
|
</dl>
|
|
|
|
<p><strong>Exit Status</strong></p>
|
|
|
|
<ul>
|
|
<li>0 if all of the named files or file hierarchies were removed,
|
|
or if the <strong>-f</strong> option was specified and all of the
|
|
existing files or file hierarchies were removed.</li>
|
|
|
|
<li>>0 if an error occurs.</li>
|
|
</ul>
|
|
|
|
<p><strong>Related information</strong></p>
|
|
|
|
<ul>
|
|
<li><a href="cp.htm">cp - Copy files</a></li>
|
|
|
|
<li><a href="ln.htm">ln - Link files</a></li>
|
|
|
|
<li><a href="ls.htm">ls - List directory contents</a></li>
|
|
|
|
<li><a href="mv.htm">mv - Move files</a></li>
|
|
|
|
<li><a href="rmdir.htm">rmdir - Remove directories</a></li>
|
|
</ul>
|
|
|
|
<strong>Examples</strong>
|
|
|
|
<ol>
|
|
<li>Remove all the files and the directory "java", as well as any
|
|
subdirectories or files, or both, and do not prompt for conformation.
|
|
|
|
<pre>
|
|
rm -r -f /home/bob/examples/code/java
|
|
</pre>
|
|
</li>
|
|
|
|
<li>Remove the files "file1", "file2" and "file3".
|
|
|
|
<pre>
|
|
rm file1 file2 file3
|
|
</pre>
|
|
</li>
|
|
</ol>
|
|
|
|
<!-- end ibmbody========================================================= -->
|
|
</body>
|
|
</html>
|
|
|