Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- find drp/ -depth -name "*abc.tab" -exec rename 's/abc.tab$/xyz.tab/' {} +
- rename 's/^[*]+/sprintf("%d_", length $&)/e' -vn *
- $ touch *{,*{,*}}abc.tab
- $ rename 's/^[*]+/sprintf("%d_", length $&)/e' -vn *
- ***abc.tab renamed as 3_abc.tab
- **abc.tab renamed as 2_abc.tab
- *abc.tab renamed as 1_abc.tab
- $ rename 's/^[*]+/sprintf("%d_", length $&)/e; s/abc/xyz/' -vn *
- ***abc.tab renamed as 3_xyz.tab
- **abc.tab renamed as 2_xyz.tab
- *abc.tab renamed as 1_xyz.tab
- python3 path/to/rename.py </path/to/files>
- ****banana.txt
- **monkey.mp3
- **************test
- 4_banana.txt
- 2_monkey.mp3
- 14_test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement