1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 11:46:00 +02:00
tldr/pages/linux/file-rename.md
Managor ae436c1b00
linux/*: add option placeholders (#16192)
* batch1

* batch2

* batch3

* batch4

* Update matchpathcon.md

* Update pages/linux/arecord.md

Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>

* Update pages/linux/arecord.md

Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>

* Update pages/linux/arecord.md

Co-authored-by: Wiktor Perskawiec <git@spageektti.cc>

---------

Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
Co-authored-by: Wiktor Perskawiec <git@spageektti.cc>
2025-04-19 21:21:53 +00:00

25 lines
760 B
Markdown

# rename
> Rename multiple files.
> Note: this page refers to the command from the `rename` Debian package.
> More information: <https://manned.org/file-rename>.
- Rename files using a Perl Common Regular Expression (substitute 'foo' with 'bar' wherever found):
`rename {{'s/foo/bar/'}} {{*}}`
- Dry-run - display which renames would occur without performing them:
`rename {{[-n|--nono]}} {{'s/foo/bar/'}} {{*}}`
- Force renaming even if the operation would remove existing destination files:
`rename {{[-f|--force]}} {{'s/foo/bar/'}} {{*}}`
- Convert filenames to lower case (use `-f` in case-insensitive filesystems to prevent "already exists" errors):
`rename 'y/A-Z/a-z/' {{*}}`
- Replace whitespace with underscores:
`rename 's/\s+/_/g' {{*}}`