Skip to content

Instantly share code, notes, and snippets.

View gallexis's full-sized avatar
:octocat:

Alexis Gallèpe gallexis

:octocat:
View GitHub Profile
@gallexis
gallexis / gist:faaf31c57fd11e864236
Created February 25, 2015 13:31
Search in linux files
Search in linux files
grep -rnw 'directory' -e "pattern"
-r is recursive, -n is line number and -w stands match the whole word. Along with these, --exclude or --include parameter could be used for efficient searching. Something like below:
grep --include=\*.{c,h} -rnw 'directory' -e "pattern"
This will only search through the files which have .c or .h extensions. Similarly a sample use of --exclude:
grep --exclude=*.o -rnw 'directory' -e "pattern"
Above will exclude searching all the files ending with .o extension. Just like exclude file it's possible to exclude/include directories through --exclude-dir and --include-dir parameter, the following shows how to integrate --exclude-dir:
@gallexis
gallexis / gist:29c2c0754f2dbf60c8f7
Last active August 29, 2015 13:55
Aspirer un site avec wget
Aspirer un site avec wget
wget -r -k -E -np --exclude-directories '/tmp' --reject 'file.php' http://tar.get/wanted/directory/
Donc la cible est http://tar.get/wanted/directory/. Les options :
-r pour parcourir tous les liens du sites.
-k conversion des liens en liens locaux.