mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-05 03:55:33 +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:
parent
52560585f9
commit
4c5b0ac222
1 changed files with 9 additions and 10 deletions
|
@ -2,19 +2,18 @@
|
||||||
|
|
||||||
> Renames multiple files.
|
> 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:
|
- Replace whitespace with underscores:
|
||||||
|
|
||||||
`rename --nows {{*.txt}}`
|
`rename 's/\s+/_/g' {{\*}}`
|
||||||
`rename 's/\s+/_/g' {{*.txt}}`
|
|
||||||
|
|
||||||
- No action, just show what renames would occur:
|
|
||||||
|
|
||||||
`rename -n {{'s/foo/bar/'}} {{*.txt}}`
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue