Last active
December 28, 2017 12:02
-
-
Save denitram/443f6d49c03ff591776a11af9a5668f3 to your computer and use it in GitHub Desktop.
bash handy tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--- Commandline history substitution | |
* Replace old by new in prevous command | |
^old^new | |
^old^new is equivalent to !!:s/old/new | |
* Replace globally | |
!!:gs/old/new | |
#--- Batch renaming file | |
* Rename something001.txt to 001.txt, something002.txt to 002.txt... | |
for f in *.txt; do mv "$f" "${f#something}";done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment