Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

command to search a keyword within files

grep <search keyword> <filename>

# -n flag displays the line numbers the keyword appear on
grep -n <search keyword> <filename>

# -C flag print a given number of lines before and after the occurrence of the search keyword
# to give more context to the search result
grep -nC <integer for lines to print before and after> <search keyword> <filename>

# -r flag asks grep to search recusively in all files and directories
grep -r "search keyword" <location e.g ~ . /Documents>

# -i to ignore case sensitive search
grep -i "Keyword" <Location to search>

# -E is used to match a regex(regular expression) pattern.
# e.g for an email address,
grep -rE -o grep -rE -o "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,6}" ~
Comment

PREVIOUS NEXT
Code Example
Shell :: How to search within a file when displayed with less program 
Shell :: ubuntu show window current desktop 
Shell :: timotei felvinczi githbun 
Shell :: docker unpause 
Shell :: verify SHA256 in Windows Power Shell 
Shell :: Payload retrieve sam and system from a live file system 
Shell :: how to look for tree in ubuntu 
Shell :: raccoon scanner error command not found 
Shell :: fork, remote setup, link 
Shell :: git init create new version-controlled projects 
Shell :: command line see whole file contents 
Shell :: match all css media queries 
Shell :: CMake 3.16.0 or higher is required. You are running version 3.10.2 
Shell :: docker mac nc command 
Shell :: flask shell context processor 
Shell :: installingf 
Shell :: linux route though zerotier 
Shell :: CMD exec gunicorn --bind :8080 --workers 1 --threads 1 --timeout 0 main:app 
Shell :: test(abc,def); = test(test1,test2); 
Shell :: rsync limit download 
Shell :: aws cli donwlaod lmvda 
Shell :: stop git advice on empty path spec 
Shell :: ARCH_LINUX : /oldroot BUG 
Shell :: awk column decimal to integer 
Shell :: mongoimport source list ubuntu 20.04 
Shell :: nmap problem binding to interface 
Shell :: ????ip l2tp add tunnel 
Shell :: ignore always ask sudo permission on folder 
Shell :: github.com:Torono909/Torono909.git 
Shell :: how to find pwd linux 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =