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 :: validate ssh key 
Shell :: how to import libraries in jupyter notebook 
Shell :: cd back 
Shell :: set upstream git 
Shell :: copy folder from ssh server to local 
Shell :: linux see hidden files 
Shell :: install node on linux 
Shell :: fatal error: jansson.h: Aucun fichier ou dossier de ce type 
Shell :: Filter in terminal 
Shell :: adavanced 
Shell :: How to build android cts? And how to add and run your test case? 
Shell :: move file force replace linux 
Shell :: bash add multui options to script 
Shell :: commandAndExit cts 
Shell :: Commit Changes With a Single Line Message or Through an Editor in git command 
Shell :: buildozer cython not found 
Shell :: Create A File Named Index.js 
Shell :: cheat.sh github 
Shell :: mac use multiple ssh keys for gihub 
Shell :: pop os headphones stopped working playing out of monitor 
Shell :: cut command in powershell windows 
Shell :: Remove all local GitHub users 
Shell :: fedora doesnt recognise hard disk 
Shell :: ubuntu error dpkg: error processing archive libc6_2.27-3ubuntu1_amd64.deb (--install): new libc6:amd64 package pre-installation script subprocess returned error exit status 1 Processing triggers for libc-bin (2.27-3ubuntu1.2) ... 
Shell :: command to display topmost cpu intensive running processes 
Shell :: force remove any folder windwos 10 command 
Shell :: create react app run linting check 
Shell :: npm ldapjs 
Shell :: angular breadcrumb from url 
Shell :: git annoted tags 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =