1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-04 04:55:32 +02:00

Rename: Condense and remove flags which require a newer version of perl. (--nows and -c are available on Ubuntu14)

This commit is contained in:
Peter Tripp 2016-01-20 03:41:12 -08:00
parent 52560585f9
commit 4c5b0ac222

View file

@ -2,19 +2,18 @@
> Renames multiple files.
- Change foo to bar in matching filenames:
- Rename files using a Perl Common Regular Expression (substitute 'foo' with 'bar' wherever found):
`rename {{'s/foo/bar/'}} {{*.txt}}`
`rename {{'s/foo/bar/'}} {{\*}}`
- Convert to lower case:
- Dry-run, display which renames would occur without performing them:
`rename -c {{*.txt}}`
`rename -n {{'s/foo/bar/'}} {{\*}}`
- Convert filenames to lower case:
`rename 'y/A-Z/a-z/' {{\*}}`
- Replace whitespace with underscores:
`rename --nows {{*.txt}}`
`rename 's/\s+/_/g' {{*.txt}}`
- No action, just show what renames would occur:
`rename -n {{'s/foo/bar/'}} {{*.txt}}`
`rename 's/\s+/_/g' {{\*}}`