From b1bf59918d926296ee7dcc3c2f43b6b33e0405b0 Mon Sep 17 00:00:00 2001 From: Hayden Schiff Date: Thu, 21 Jan 2016 18:42:37 -0500 Subject: [PATCH] mmv: add page --- pages/common/mmv.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/common/mmv.md diff --git a/pages/common/mmv.md b/pages/common/mmv.md new file mode 100644 index 0000000000..1dcbd65545 --- /dev/null +++ b/pages/common/mmv.md @@ -0,0 +1,19 @@ +# mmv + +> Move and rename files in bulk. + +- Rename all files with a certain extension to a different extension: + +`mmv "*{{.old_extension}}" "#1{{.new_extension}}"` + +- Copy report6part4.txt to ./french/rapport6partie4.txt along with all similarly named files: + +`mmv -c {{"report*part*.txt"}} {{"./french/rapport#1partie#2.txt"}}` + +- Append all .txt files into one file: + +`mmv -a "*.txt" {{"all.txt"}}` + +- Convert dates in filenames from "M-D-Y" format to "D-M-Y" format: + +`mmv "[0-1][0-9]-[0-3][0-9]-[0-9][0-9][0-9][0-9].txt" "#3#4-#1#2-#5#6#7#8.txt"`