Find and Replace command for ubuntu/Linux
Find and Replace sed command for Ubuntu/Linux Find and replace the occurrence of particular string in a directory or sub directory using below mention commands: Search for the occurrence of the string in directory or sub-directory. grep -rl . 2> /dev/null Find and replace the occurrence of given string in a directory and its subdirectory, ex: Replace 'foo' with 'bar'. find . -exec sed -i -e 's/foo/bar/g' {} \; Find and replace the occurrence of given string as website URL with given string in a directory and its subdirectory, ex: Replace 'http://www.example.com/foo' with 'bar'. find . -exec sed -i -e 's+http://www.example.com/foo+/bar+g' {} \; -:END:-