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 :: installing xournal++ in ubuntu 
Shell :: bash if element in array 
Shell :: login without a password is forbidden by configuration (see allownopassword) ubuntu 
Shell :: @react-navigation/stack install 
Shell :: install angular animation 10.0.12 
Shell :: install k3s 
Shell :: how to install mongoose 
Shell :: remove pods from xcode project terminal 
Shell :: ubuntu start php 
Shell :: run a nuget package restore to generate this file 
Shell :: how to install lazygit on ubuntu 
Shell :: install sdkman ubuntu 
Shell :: how to share gatsby project on lan 
Shell :: update nextjs to last version 
Shell :: make all files in directory executable 
Shell :: git log with date 
Shell :: remove all files with extension bash 
Shell :: delete all migrations django 
Shell :: m1 cocoapods 
Shell :: check if django is installed 
Shell :: centos cpus 
Shell :: install webpack cli 
Shell :: how to uninstall kernel jupyter 
Shell :: vim empty line 
Shell :: dev/kvm device permission denied 
Shell :: Command `npm install --save --save-exact react-native` failed 
Shell :: traceroute ubuntu command 
Shell :: open visual studio code from terminal mac 
Shell :: powershell change hostname 
Shell :: uninstall figma from linux distributions 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =