Skip to content

Instantly share code, notes, and snippets.

@Eddy-Barraud
Last active January 30, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eddy-Barraud/cdc178904ff4bfe6e21f540db9c4e202 to your computer and use it in GitHub Desktop.
Save Eddy-Barraud/cdc178904ff4bfe6e21f540db9c4e202 to your computer and use it in GitHub Desktop.

Search for a word inside every files in current folder and replace it with sed

One line

find . -type f -print0 -exec sed -i 's/hello/hi/g' {} +

(we can add -name "*.txt" option to restrict the recursion and speed up the work)

Just for searching

grep -R {something_to_look_for} {where_to_look_in}

Using locate to search for file NAME

(before run updatedb)

locate {word}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment