Created
June 5, 2020 11:51
-
-
Save suchoudh/3918786f69a3645d44da1f421a5d0a09 to your computer and use it in GitHub Desktop.
find and replace recursively in direcoty
This file contains hidden or 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
| 74 Script done on 2020-06-04 12:57:09+0530 | |
| 75 find . -name *.txt -not -path '*/\.*' -print0 | xargs -0 -exec l s -la {} + | |
| 76 find . -name *.txt -not -path '*/\.*' -print0 | xargs -0 sed -i 's/#/~/g' | |
| 77 | |
| 78 -exec rename _dbg.txt .txt '{}' \; | |
| 79 | |
| 80 | |
| 81 | |
| 82 Find txt files and rename them to be md | |
| 83 | |
| 84 find . -name "*.txt" -exec rename 's/\.txt$/.md/' '{}' \; | |
| ~ |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
find . -name ".txt" -not -path '/.' -print0 | xargs -0 -exec ls -la {} + >> find_ls_la.txt 1
find . -name "_." -not -path '/.' -not -path '703' -print0 | xargs -0 -exec ls
find . -name "_.md" -not -path '/.' -not -path '703' -print0 | xargs -0 -exec rename 's/_.md$/1.*/' '{}' ; # BLOCK BUSTER FAIL
saaaf kardi # Jai gandhi baba .. Actually what did Ghandhi do .. its your doing. ... be ready to own up your shi%T
find . -name "_.md" -not -path '/.' -not -path '703' -print0 | xargs -0 -exec rename 's/_.md$/1*.*/' '{}' ;