87_gug
Last Updated: February 25, 2016
·
752
· yachi

search and replace files oneliner

add this to your .bashrc or .zshrc

alias pie="perl -p -i -e "

Usage

basic

pie 's#[search]#[replace]#g' [filenames]

search and replace http with https from files with name ended with html in this git repo

pie 's#http#https#g' `git ls-files|grep html$`

2 Responses
Add your response

9992

I prefer using sed -i.

over 1 year ago ·
9999

good tip! didn't know the -i option, always wondering how to do that with sed

over 1 year ago ·