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 :: ffmpeg scale but keep aspect ratio 
Shell :: apt remove package completely with configuration 
Shell :: powershell rename wildcard 
Shell :: doker desktop ffailed to initailise 
Shell :: reac native /bin/sh: adb: command not found 
Shell :: linux convert to sha512 
Shell :: how to open powershell in windows container 
Shell :: screen record on fedora 
Shell :: pbcopy alternative wsl linux 
Shell :: git find the commit that introduced a bug 
Shell :: mongo import all from bson 
Shell :: Add the Inkscape repository to your apt package manager 
Shell :: how do i get buster and gnome chromebook 
Shell :: git change autor of all comits 
Shell :: git borrar rama local y remote 
Shell :: docker laravel configuration ubuntu 
Shell :: lacie 2tb thunderbolt linux mount drive 
Shell :: how to open pg_hba.conf file in ubuntu using visual studio 
Shell :: ssh copy id to remote sever 
Shell :: install graphene federation 
Shell :: linux audacity installieren 
Shell :: install extra requires 
Shell :: How to list unit files with systemctl command specifying a unit type 
Shell :: ssh local 
Shell :: how to upgrade .rpm file in linux 
Shell :: how to apply password to folder and file shell scripting in linux 
Shell :: docker in linux 
Shell :: ufw rules 
Shell :: linux cut all but last field 
Shell :: git short version hash [by index] 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =