Post History
I compressed some JPEGs with curtail it messed up the filenames. It was supposed to only add -min at the end but ended up adding a random string after the extension 😠: prs@PC:/DOWNLOADS/Pictures$ ...
Question
renaming
#2: Post edited
Rename multiple files which have a variable suffix
Hello fellow community 👋**_Curtail_** did a good job at compressing my JPEG pictures but a **very bad job** at naming them... 😑It was supposed to only add `-min` at the end but ended up adding a **random string** after the extension 😠 :- ```
- prs@PC:/DOWNLOADS/Pictures$ find . -type f
- ./IMG_20230917_093726_2-min.jpg-U2XlUA <<< To rename "[...]_2-min.jpg"
- ./IMG_20230917_093726_2.jpg - Don't do anything
- ./IMG_20230917_093738_3-min.jpg-H39QsD <<< To rename "[...]_3-min.jpg"
- ./IMG_20230917_093738_3.jpg - Don't do anything
- ./IMG_20230917_094057_1-min.jpg-AbxJMt <<< To rename "[...]_1-min.jpg"
- ./IMG_20230917_094057_1.jpg - Don't do anything
- ```
<br>**My question is:** How can I remove the random string for each `-min` file?I already have a **find** command that gets the `-min` files while excluding the pictures I don't want to touch:- ```
- find . -name "*-min.jpg-*"
```<br>Your help would be greatly appreciated 🙂Cheers! ✌️
- I compressed some JPEGs with `curtail` it messed up the filenames. It was supposed to only add `-min` at the end but ended up adding a **random string** after the extension 😠:
- ```
- prs@PC:/DOWNLOADS/Pictures$ find . -type f
- ./IMG_20230917_093726_2-min.jpg-U2XlUA <<< To rename "[...]_2-min.jpg"
- ./IMG_20230917_093726_2.jpg - Don't do anything
- ./IMG_20230917_093738_3-min.jpg-H39QsD <<< To rename "[...]_3-min.jpg"
- ./IMG_20230917_093738_3.jpg - Don't do anything
- ./IMG_20230917_094057_1-min.jpg-AbxJMt <<< To rename "[...]_1-min.jpg"
- ./IMG_20230917_094057_1.jpg - Don't do anything
- ```
- How can I remove the random string for each `-min` file?
- I already have a `find` command that gets the `-min` files while excluding the pictures I don't want to touch:
- ```
- find . -name "*-min.jpg-*"
- ```
#1: Initial revision
Rename multiple files which have a variable suffix
Hello fellow community 👋 **_Curtail_** did a good job at compressing my JPEG pictures but a **very bad job** at naming them... 😑 It was supposed to only add `-min` at the end but ended up adding a **random string** after the extension 😠 : ``` prs@PC:/DOWNLOADS/Pictures$ find . -type f ./IMG_20230917_093726_2-min.jpg-U2XlUA <<< To rename "[...]_2-min.jpg" ./IMG_20230917_093726_2.jpg - Don't do anything ./IMG_20230917_093738_3-min.jpg-H39QsD <<< To rename "[...]_3-min.jpg" ./IMG_20230917_093738_3.jpg - Don't do anything ./IMG_20230917_094057_1-min.jpg-AbxJMt <<< To rename "[...]_1-min.jpg" ./IMG_20230917_094057_1.jpg - Don't do anything ``` <br> **My question is:** How can I remove the random string for each `-min` file? I already have a **find** command that gets the `-min` files while excluding the pictures I don't want to touch: ``` find . -name "*-min.jpg-*" ``` <br> Your help would be greatly appreciated 🙂 Cheers! ✌️