Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

grep lines after match

$ grep -A1 text

-AX tells grep to display 'X' amount of lines after line of match. 
Use -BX to do the same but before.
Comment

grep line after match

Include -A flag to add lines after match and -B flag to add lines before
grep match -A 3	#display match line and 3 after lines
grep match -B 2 #display match line and 2 lines before
Comment

grep third line after match

Include -A flag to add lines after match
grep match -A 3	#display match line and 3 after lines
Comment

PREVIOUS NEXT
Code Example
Shell :: uninstall libxcb 
Shell :: import local varibles inside .sh file 
Shell :: run script on files in folder output to file 
Shell :: powerrshell adobject get all deleted 
Shell :: mac find exclude a directory 
Shell :: command line remove Unrecognized character xC3; 
Shell :: GHDB categories 
Shell :: Linux Tor enabled 
Shell :: ubuntu aide compare file structure 
Shell :: Linux Terminal has lost its colours 
Shell :: install imamgemagic 
Shell :: fslsplit 
Shell :: linux head command get 2nd line 
Shell :: systemd enable sshd services 
Shell :: run a pomdp file to get policy file 
Shell :: timer in terminal ubuuntu 
Shell :: sbatch how submitted location using jobid 
Shell :: bash script speichern from speed test in influxdb 
Shell :: snap uninstall docker 
Shell :: install tag gz 
Shell :: $OuTree = Get-ADOrganizationalUnit -Filter * -SearchBase 
Shell :: centos 8 gui 3 
Shell :: hadoop distcp diff snapshot 
Shell :: bash find files and operator 
Shell :: install google client api individually 
Shell :: hub create private 
Shell :: how to clear/delete/remove/erase/wipe/forget shell traps 
Shell :: add computer to collection powershell 
Shell :: bevy clone 
Shell :: create ionic v3 project 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =