From 6cf81f993ac815b5feca9e568a9ee3053e3ae1b7 Mon Sep 17 00:00:00 2001 From: Emily Grace Seville Date: Sun, 8 Jan 2023 01:31:17 +1000 Subject: [PATCH] rm: add/refresh pages (#7994) * Add `rm` page copy with long options * Refresh title * Refresh pages: - better grammar/syntax - `See also` links - reorder examples * Use imperative mood in titles * Don't use brace expansion * Use `and` instead of `/` for `-r` examples Co-authored-by: Axel Navarro Co-authored-by: Axel Navarro --- pages/common/rm.md | 23 ++++++++++++----------- pages/linux/rm.md | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 pages/linux/rm.md diff --git a/pages/common/rm.md b/pages/common/rm.md index 6201bf012..da1b9ca8e 100644 --- a/pages/common/rm.md +++ b/pages/common/rm.md @@ -1,24 +1,25 @@ # rm > Remove files or directories. +> See also: `rmdir`. > More information: . -- Remove files from arbitrary locations: +- Remove specific files: -`rm {{path/to/file}} {{path/to/another/file}}` +`rm {{path/to/file1 path/to/file2 ...}}` -- Recursively remove a directory and all its subdirectories: +- Remove specific files ignoring nonexistent ones: -`rm -r {{path/to/directory}}` +`rm -f {{path/to/file1 path/to/file2 ...}}` -- Forcibly remove a directory, without prompting for confirmation or showing error messages: - -`rm -rf {{path/to/directory}}` - -- Interactively remove multiple files, with a prompt before every removal: +- Remove specific files [i]nteractively prompting before each removal: `rm -i {{path/to/file1 path/to/file2 ...}}` -- Remove files in verbose mode, printing a message for each removed file: +- Remove specific files printing info about each removal: -`rm -v {{path/to/directory/*}}` +`rm -v {{path/to/file1 path/to/file2 ...}}` + +- Remove specific files and directories [r]ecursively: + +`rm -r {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` diff --git a/pages/linux/rm.md b/pages/linux/rm.md new file mode 100644 index 000000000..784999769 --- /dev/null +++ b/pages/linux/rm.md @@ -0,0 +1,25 @@ +# rm + +> Remove files or directories. +> See also: `rmdir`. +> More information: . + +- Remove specific files: + +`rm {{path/to/file1 path/to/file2 ...}}` + +- Remove specific files ignoring nonexistent ones: + +`rm --force {{path/to/file1 path/to/file2 ...}}` + +- Remove specific files interactively prompting before each removal: + +`rm --interactive {{path/to/file1 path/to/file2 ...}}` + +- Remove specific files printing info about each removal: + +`rm --verbose {{path/to/file1 path/to/file2 ...}}` + +- Remove specific files and directories recursively: + +`rm --recursive {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`