Guest User

Untitled

a guest
Nov 18th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. [root@centos6 bin]# grep -A 2 -B 2 "SampleTextFile.txt" /var/log/messages
  2. Nov 10 00:14:54 centos6 kernel: Kernel logging (proc) stopped.
  3. Nov 10 00:14:54 centos6 rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1513" x-info="http://www.rsyslog.com"] exiting on signal 15.
  4. File SampleTextFile.txt
  5. First Line after original SampleTextFile.txt
  6. Nov 12 18:13:48 centos6 kernel: imklog 5.8.10, log source = /proc/kmsg started.
  7. Nov 12 18:13:48 centos6 rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1519" x-info="http://www.rsyslog.com"] start
  8. --
  9. Nov 12 18:14:19 centos6 polkitd[2382]: started daemon version 0.96 using authority implementation `local' version `0.96'
  10. Nov 12 18:14:19 centos6 rtkit-daemon[2388]: Sucessfully made thread 2386 of process 2386 (/usr/bin/pulseaudio) owned by '42' high priority at nice level -11.
  11. File SampleTextFile.txt
  12. Second Line after original SampleTextFile.txt
  13. Nov 12 18:14:19 centos6 pulseaudio[2386]: alsa-util.c: Disabling timer-based scheduling because running inside a VM.
  14. Nov 12 18:14:19 centos6 rtkit-daemon[2388]: Sucessfully made thread 2392 of process 2386 (/usr/bin/pulseaudio) owned by '42' RT at priority 5.
  15. [root@centos6 bin]#
  16.  
  17. [root@centos6 bin]# grep -m 1 -A 2 -B 2 "SampleTextFile.txt" /var/log/messages
  18. Nov 10 00:14:54 centos6 kernel: Kernel logging (proc) stopped.
  19. Nov 10 00:14:54 centos6 rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1513" x-info="http://www.rsyslog.com"] exiting on signal 15.
  20. File SampleTextFile.txt
  21. [root@centos6 bin]#
  22.  
  23. [root@centos6 bin]# grep -V
  24. grep (GNU grep) 2.20
  25. Copyright (C) 2014 Free Software Foundation, Inc.
  26. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
  27. This is free software: you are free to change and redistribute it.
  28. There is NO WARRANTY, to the extent permitted by law.
  29.  
  30. Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
  31. [root@centos6 bin]#
Add Comment
Please, Sign In to add comment