我使用grep來查找具有我的搜索字符的行。隨着這條線,我希望以前的線以及後面的線。從文件中獲取前一行和後一行
For example
cat test.csv
bbbbbbbbbbbbb
xxx234.123yyy
abc123.456efg
zzz789.222xxx
aaaaaaaaaaaaa
grep '123.456' test.csv
I get a line say,
abc123.456efg
Addition to that I need like this
xxx234.123yyy
abc123.456efg
zzz789.222xxx