Horje
bash find files containing string Code Example
command line how to find all files that have a string
grep -rnw '/path/to/somewhere/' -e 'pattern'
bash find all files containing string
grep -r '/path/to/somewhere/' -e 'pattern'
bash find files containing string
# Basic syntax:
find /top/dir -mindepth int -maxdepth int -type f -exec grep -H 'string' {} \;
# Note, this might look a bit scary, but it's worth learning
# Where:
#	- find searches recursively through all directories in the /top/directory
#	- -mindepth and maxdepth set the depth of subdirectories to search
#	- -type f indicates that only files should be considered
#	- all files found using the above criteria are iteratively passed to exec 
#		via the curly braces. exec then runs grep which searches for the word
#		'string' in the file
#	- -H tells grep to return the filename along with the matching line




Shell

Related
bash create symlinks Code Example bash create symlinks Code Example
install node on linux instance Code Example install node on linux instance Code Example
django cors install Code Example django cors install Code Example
kill port linus Code Example kill port linus Code Example
python3 install mutagen Code Example python3 install mutagen Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11