Rm (Unix)

From DssWiki

Jump to: navigation, search

{{DISPLAYTITLE:{{#if:|:|}}rm (Unix)}} Template:Wikibookspar rm (short for remove) is a Unix command used to delete files from a filesystem. Common options that rm accepts include:

  • -r, which removes directories, removing the contents recursively beforehand
  • -i, which asks for every deletion to be confirmed
  • -f, which ignores non-existent files and overrides any confirmation prompts ("force")

rm is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option (as the option specified later on the expanded command line "rm -i -f" takes precedence).

rm -rf (variously, rm -rf /, rm -rf *, and others) is frequently used in jokes and anecdotes about Unix disasters. The rm -rf / variant of the command, if run by an administrator, would cause the contents of every writable mounted filesystem on the computer to be deleted.

rm is often used in conjunction with xargs to supply a list of files to delete:

    xargs rm <filelist

[edit] See also

[edit] External links

  • [{{Man/{{#if:Linux

|Linux|default}}|1|rm|url}} rm{{#if:{{Man/{{#if:Linux |Linux|default}}|1|rm|display_section}}|({{Man/{{#if:Linux |Linux|default}}|1|rm|display_section}})}}]{{#if:remove files or directories|: remove files or directories}}{{#if:{{#ifeq: |inline||{{Man/{{#if:Linux |Linux|default}}|1|rm|attrib}}}}| – {{#ifeq: |inline||{{Man/{{#if:Linux |Linux|default}}|1|rm|attrib}}}}}}


<noinclude>
Personal tools
efta 468 03-27-08 JOIN OUR TEAM!!