HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

zmv — Move or rename files matching a specified extended glob pattern. More information: <https://zsh.sour

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandfileszmvclimovespecifiedmatchingrename

Problem

How to use the zmv command: Move or rename files matching a specified extended glob pattern. More information: <https://zsh.sourceforge.io/Doc/Release/User-Contributions.html>.

Solution

zmv — Move or rename files matching a specified extended glob pattern. More information: <https://zsh.sourceforge.io/Doc/Release/User-Contributions.html>.

Move files using a regex-like pattern:
zmv '{{(*).log}}' '{{$1.txt}}'


Preview the result of a move, without making any actual changes:
zmv -n '{{(*).log}}' '{{$1.txt}}'


Interactively move files, with a prompt before every change:
zmv -i '{{(*).log}}' '{{$1.txt}}'


Verbosely print each action as it's being executed:
zmv -v '{{(*).log}}' '{{$1.txt}}'

Code Snippets

Move files using a `regex`-like pattern

zmv '{{(*).log}}' '{{$1.txt}}'

Preview the result of a move, without making any actual changes

zmv -n '{{(*).log}}' '{{$1.txt}}'

Interactively move files, with a prompt before every change

zmv -i '{{(*).log}}' '{{$1.txt}}'

Verbosely print each action as it's being executed

zmv -v '{{(*).log}}' '{{$1.txt}}'

Context

tldr-pages: common/zmv

Revisions (0)

No revisions yet.