Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to print next lines with grep

grep -A 2 "searchText" mytext.txt ## next 2 lines after match line
grep -B 2 "seacrchText" mytext.txt ## next 2 lines before match line
grep -C 2 "searchText" mytext.txt ## next 2 lines before and after match line
Comment

how to print next lines with grep

grep -A 2 "searchText" mytext.txt ## next 2 lines after match line
grep -B 2 "seacrchText" mytext.txt ## next 2 lines before match line
grep -C 2 "searchText" mytext.txt ## next 2 lines before and after match line
Comment

print next 10 lines after grep

grep -A 2 "app" mytext.txt //prints two lines after the match line
grep -B 2 "app" mytext.txt //prints two lines before the match line
Comment

how to print next lines with grep

grep -A 2 "searchText" mytext.txt ## next 2 lines after match line
grep -B 2 "seacrchText" mytext.txt ## next 2 lines before match line
grep -C 2 "searchText" mytext.txt ## next 2 lines before and after match line
Comment

PREVIOUS NEXT
Code Example
Shell :: download directory ssh linux 
Shell :: bash substitution 
Shell :: regex last match 
Shell :: how to use usb 3 with virtualbox 
Shell :: nodemon installation 
Shell :: append a string in all files name linux 
Shell :: git force overwrite of local files 
Shell :: git make new branch 
Shell :: git revert to last commit on remote branch 
Shell :: odoo 14 install ubuntu 20.04 
Shell :: how to use git stash in current branch 
Shell :: linux grep regex return match 
Shell :: command to create jpeg in linux 
Shell :: winscp zip command 
Shell :: linux ubuntu update time 
Shell :: install node_modules folder 
Shell :: start elasticsearch on aws 
Shell :: doxygen install 
Shell :: increase swap size ubuntu 
Shell :: bitbucket ssh key not working 
Shell :: how to make directories in linux 
Shell :: get date windows batch 
Shell :: git interactive rebase 
Shell :: create a new file in bash script 
Shell :: arch linux wine 
Shell :: curl with regex 
Shell :: how to remove package files in linux 
Shell :: npm install firebase @angular/fire 
Shell :: syslog-ng[31899]: error processing log message: <111 splunk format 
Shell :: recursive rename powershell 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =