Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

grep text in files

grep -rnw '/path/to/somewhere/' -e 'pattern'

-r or -R is recursive,
-n is line number, and
-w stands for match the whole word.
-l (lower-case L) can be added to just give the file name of matching files.
-e is the pattern used during the search
Comment

grep string in file

if grep -Fxq "pattern_to_search" file.txt; then #check if pattern string in file
  #do something
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: how to open a file using terminal 
Shell :: create cron job from command line 
Shell :: There is 1 zombie process 
Shell :: pipi ungrade 
Shell :: How to discard files from stash in git 
Shell :: install spacemacs 
Shell :: npm install quiet 
Shell :: git delete commit 
Shell :: merge branch to branch 
Shell :: gitignore folder 
Shell :: drupal cli composer 
Shell :: commit unstaged changes to new branch 
Shell :: Download Kubectl - latest release 
Shell :: How to update newer git version on ubuntu 18.04 by using command line terminal. 
Shell :: scp from local to remote 
Shell :: linux c programm time 
Shell :: git ignore file is not working 
Shell :: putty export / download all sessions 
Shell :: cmd file list to text 
Shell :: crontab example 
Shell :: open video linux terminal 
Shell :: umask linux 
Shell :: how to get all avd names in cmd 
Shell :: proxy shell 
Shell :: download composer version 1.6.5 
Shell :: how to instal git on mac 
Shell :: sed between two matches 
Shell :: github bullet points 
Shell :: docker swarm get nodes 
Shell :: revert changes to all files of a type git 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =