rm

This is a ManXample entry for the "rm" command.

This is the area to propose additional strings, comments, tips, work-flows, examples, and reference for commands and daemons. ManXamples will be added to the bottom of the official manpage entries the following standard format, so people can always find them and the listings are uniform. Please look at the commands listed before adding more, so work is not duplicated. If needed, simply add a function to an existing command if it adds significant value without complicating the spirit of the original example. If there is a more elegant way to complete a task listed, feel free to list it as a note to the relevant entry.

1) To remove a directory, use the following command:

  • sudo rm -R dirname

2) To remove a file, use the following command:

  • sudo rm filename

3) To remove multiple directories, use the following command:

  • sudo rm -R dirname dirname dirname

4) To remove multiple directories with wildcards, use the following command:

  • sudo rm -R dirname dirname dirname *commonvalue*

    • Note: To remove all empty folders from the current folder, a perl script might be easier:

      • perl -MFile::Find -e"finddepth(sub{rmdir},'.')"

ManXamples/rm (last edited 2008-09-27 17:48:03 by martin0641)