From 5f72f9623dcf35457c060387085c3c8e5ccde785 Mon Sep 17 00:00:00 2001 From: testbughub <30836300+testbughub@users.noreply.github.com> Date: Sun, 6 Apr 2025 21:18:26 +0200 Subject: [PATCH] rnm: add page (#16115) Co-authored-by: Managor <42655600+Managor@users.noreply.github.com> Co-authored-by: Wiktor Perskawiec --- pages/linux/rnm.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/linux/rnm.md diff --git a/pages/linux/rnm.md b/pages/linux/rnm.md new file mode 100644 index 0000000000..a83386fabc --- /dev/null +++ b/pages/linux/rnm.md @@ -0,0 +1,36 @@ +# rnm + +> Bulk Rename Utility. +> More information: . + +- Replace a search string with a replacement string in filenames: + +`rnm -ss {{old}} -rs {{new}} {{path/to/directory}}` + +- Use a fixed (literal) search and replace string instead of regex: + +`rnm -ssf {{old}} -rs {{new}} {{path/to/files}}` + +- Add an auto-incremented index to filenames starting from 1: + +`rnm -i 1 -inc 1 -rs {{_}} {{path/to/files}}` + +- Rename files using a list of new names from a text file: + +`rnm -ns/f {{path/to/names.txt}} {{path/to/files}}` + +- Rename only files (ignoring directories and links): + +`rnm -fo -ss {{pattern}} -rs {{replacement}} {{path/to/files}}` + +- Sort input files by modification time before renaming: + +`rnm -s/mt -ss {{pattern}} -rs {{replacement}} {{path/to/files}}` + +- Run a simulation without making actual changes: + +`rnm -sim -ss {{pattern}} -rs {{replacement}} {{path/to/files}}` + +- Undo the last renaming operation: + +`rnm -u`