Created
November 21, 2022 17:51
-
-
Save bsnux/6db4f4e6d605d96dcf1c66f9ed185ad2 to your computer and use it in GitHub Desktop.
Perl one-liners
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
# Starting REPL | |
perl -del | |
# Search and replace in place | |
perl -p -i -e "s/test/testing/g" /tmp/testing.txt | |
# Search/replace in specific files in a directory | |
perl -p -i -e 's/oldstring/newstring/g' `find ./ -name *.html` | |
# Similar to awk | |
ls -l | perl -lane 'print $F[2]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment