Score:-1

Rename files so that it only contain numbers

in flag

I have a bunch of files that looks like this:

[Skymoon Raws] Mushoku Tensei - 06 [ViuTV][WEB-DL][1080p][AVC AAC].mp4
[Skymoon Raws] Mushoku Tensei - 07 [ViuTV][WEB-DL][1080p][AVC AAC].mp4

And I want it to look like this:

061080.mp4
071080.mp4

Remove all occurrence of "1080" if possible.

Score:2
cn flag

Renaming files by wildcard pattern.

mmv '* Mushoku Tensei - * \[*\]\[*\]\[*p\]*' '#2#5.mp4'
                        ^             ^
                        2             5

The order of a wildcard character or a range pattern will be represented by a number sign in the to pattern.

  • ; Expands to any number of directories (same as **/).
  • * Matches any character zero or more times.
  • ? Matches any single character.
  • [] Matches a list or and a range of characters.
  • # References to the nth wildcard char in the from pattern.
Liso avatar
sd flag
You sure its `mmv` ? I type it on my box and it says I have to install `mmv`
bac0n avatar
cn flag
yes, `apt install mmv` or `zmv` for zsh shells
user10489 avatar
in flag
There are several commands that do things like this (none installed by default). `mmv` looks to be one of the simpler ones.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.