To get the lines after from matching line use following pattern
input-text | grep -A NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -A 4 "Jun 8"
2:
To get the lines before from matching line use following pattern
input-text | grep -B NUM pattern-to-match
NUM is specify the number lines to printed or taken from input text
for example:
sudo ausearch -f / |grep -B 4 "Jun 8"
Subscribe to:
Post Comments (Atom)
Linux Kernel Compilation
Step 1: Install Required Packages Install additional packages before building a kernel. To do so, run this command: sudo apt-get install gi...
-
Step:1 sudo apt-get install python-pip Step:2 pip install -U selenium for python3 and more install Step:1 sudo apt-get...
-
TOKEN=$(curl -u "<username>:<password>" -k -X GET "https://<hostname or ip address>:<port number>/se...
-
Step 1: Install Required Packages Install additional packages before building a kernel. To do so, run this command: sudo apt-get install gi...
No comments:
Post a Comment