Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

grep check line exists in file

grep -F -q -e 'search string' textfile.txt || echo 'Not found'
Note:

-F prevents the interpretation of the search string as a regular expression.
-q suppresses all output and returns immediately after the first instance was found, making the search much faster if the string occurs at the beginning of a large file.
-e specifies the pattern explicitly, allowing patterns that start with a dash.
Use single quotes unless you want variable substitutions.
Comment

PREVIOUS NEXT
Code Example
Shell :: get-distributiongroupmember exchange online missing cmdlet 
Shell :: bash cp command error with parenthesis 
Shell :: get jre path terminal macos 
Shell :: even digits leetcode 
Shell :: android studio install flutter 
Shell :: sed variable instead of file 
Shell :: mybatis plus version 
Shell :: tarball -list 
Shell :: shell -eq 
Shell :: unrar into directory 
Shell :: alembic not found 
Shell :: kdevtmpfsi 
Shell :: Command to print list of environment variables in bash 
Shell :: hide active app from dock 
Shell :: init step way to create repository git 
Shell :: sed replace from match 
Shell :: powershell update help 
Shell :: install lua in ubuntu 
Shell :: bitbucket Permission denied (publickey). fatal: Could not read from remote repository. 
Shell :: change date and time in kali linux 2021 
Shell :: flutter release mode 
Shell :: rename directory from command line 
Shell :: show saved network connections linux 
Shell :: Instal helm ubuntu linux 
Shell :: pip install pytorchvideo_trainer 
Shell :: error while installing DKphotogallery in xcode 
Shell :: npm ERR! code ENOENT npm ERR! syscall rename while trying to install npm install react-native-maps --save-exact 
Php :: human readable date laravel 
Php :: laravel version command 
Php :: if user logged in wordpress 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =