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

ubuntu grep text in files

grep -r "mydomain.com" /etc/apache2/
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 :: nmcli connect wifi 
Shell :: get pytorch version version in ubuntu 
Shell :: delete all files smaller than a certain size linux 
Shell :: get connected wifi password windows 11 
Shell :: change commit date linux 
Shell :: listen tcp 127.0.0.1:8001: bind: address already in use 
Shell :: bash curl forecast 
Shell :: Remove folder recursively using powershell 
Shell :: how to go to a running docker container 
Shell :: bash calculate the mean of a column 
Shell :: how to kill port in linux 
Shell :: how to install admin-lte with npm 
Shell :: chkconfig httpd on Amazon Linux 2 AMI 
Shell :: generate ssh key paitr 
Shell :: install kivy pip 
Shell :: batch copy silent 
Shell :: homebrew install in ubuntu 
Shell :: scrcpy install 
Shell :: show git tree in terminal 
Shell :: zsh create alias 
Shell :: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
Shell :: find large files in ubuntu 
Shell :: increase ssh session timeout linux 
Shell :: nx remove lib 
Shell :: linux find files by name 
Shell :: windows temp dir 
Shell :: vs code always says rebasing git 
Shell :: reconnaissance in cyber security 
Shell :: k8s get current context 
Shell :: scss in gatsby 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =