Files
cheatsheet-tldr/tldr/zmv
2025-12-21 00:23:35 +00:00

26 lines
629 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}'`