Skip to content

Instantly share code, notes, and snippets.

@lifofernandez
Last active March 16, 2016 21:50
Show Gist options
  • Save lifofernandez/3ba007f6792a0dc6ae35 to your computer and use it in GitHub Desktop.
Save lifofernandez/3ba007f6792a0dc6ae35 to your computer and use it in GitHub Desktop.
#recursive find & replace in contents http://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files
find . -type f -exec sed -i 's/SEARCH/REPLACE/g' {} +
# Replace text in multiple filenames (only first lvl)
for i in *; do mv "$i" "${i//bartik/semanticui}"; done
#buscar lineas que NO contengan cierta palabra
^((?!SEARCH).)*$
# Vim bring n lines from other file
:r! sed -n 147,227p /path/to/foo/foo.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment