snippets : recursive search and replace in linux with find and sed

Shell : recursive search and replace in linux with find and sedreplace all occurences of oldtext with newtext in any .py file in /home/juju/project directory
#!/bin/sh

find /home/juju/project -iname '*.py' -exec sed -i 's/oldtext/newtext/g' {} \
tags : system, bash

all tags : python, system, vlc, video, apache, proxy, linux, django, MySQL, .NET, XML, XSL, regexp, bat, windows, bash, git

back to snippets home
site réalisé et hébergé par revolunet © 2009 - informations légales