在尾部-f输出中包含特定模式或字符串的Ommit行

时间:2016-11-10 17:39:43

标签: shell unix tail

我认为一切都在标题中。这里有更多信息:我在一个单独的屏幕上将大量数据写入我想要tail -f的日志文件中。我希望将所有数据写入文件,但我不需要tail -f输出中的所有数据。例如,而不是

= 2016-11-10 17:11:06 ==========================================================
PONG not logged
================================================================================
= 2016-11-10 17:11:07 ==========================================================
PONG Stan
================================================================================
= 2016-11-10 17:11:07 ==========================================================
MatchMaking { id: '20',
  email: 'stanley@beatme.io',
  gender: 'male',
  fbid: '167198360375634',
  console: '5',
  game: '5',
  beatmeid: 'Stan',
  fairplay: 100,
  victories: 32,
  wallet: 11950 }
================================================================================
= 2016-11-10 17:11:07 ==========================================================
User  Stan Started MatchMaking
================================================================================
MatchMaking : user Stan successfully joined
user 20 resumed MatchmakingActivity
= 2016-11-10 17:11:08 ==========================================================
PONG not logged
================================================================================
================================================================================
= 2016-11-10 17:11:08 ==========================================================
PONG kejjimourad
================================================================================
= 2016-11-10 17:11:09 ==========================================================
PONG not logged
================================================================================
Matched players Kijey and Stan
tryStartGame 5-5
areYouReady [ 274, 20 ]
Matched 1 in one round
= 2016-11-10 17:11:10 ==========================================================
PONG not logged
================================================================================
= 2016-11-10 17:11:10 ==========================================================
Notification sent { success: true,
  data: [Object] }
================================================================================
= 2016-11-10 17:11:10 ==========================================================
Notification sent { success: true,
  data:
   { multicast_id: 8703116803504844000,
     success: 1,
     failure: 0,
     canonical_ids: 0,
     results: [ [Object] ] } }
================================================================================
= 2016-11-10 17:11:10 ==========================================================
PONG kejjimourad
================================================================================
= 2016-11-10 17:11:11 ==========================================================
PONG Stan
================================================================================

我希望我可以省略所有包含“PONG”的行(如果可能的话,上面一行和下面一行),这样我只有相关的信息,即:

= 2016-11-10 17:11:07 ==========================================================
MatchMaking { id: '20',
  email: 'stanley@beatme.io',
  gender: 'male',
  fbid: '167198360375634',
  console: '5',
  game: '5',
  beatmeid: 'Stan',
  fairplay: 100,
  victories: 32,
  wallet: 11950 }
================================================================================
= 2016-11-10 17:11:07 ==========================================================
User  Stan Started MatchMaking
================================================================================
MatchMaking : user Stan successfully joined
user 20 resumed MatchmakingActivity
Matched players Kijey and Stan
tryStartGame 5-5
areYouReady [ 274, 20 ]
Matched 1 in one round
= 2016-11-10 17:11:10 ==========================================================
Notification sent { success: true,
  data: [Object] }
================================================================================
= 2016-11-10 17:11:10 ==========================================================
Notification sent { success: true,
  data:
   { multicast_id: 8703116803504844000,
     success: 1,
     failure: 0,
     canonical_ids: 0,
     results: [ [Object] ] } }
================================================================================

0 个答案:

没有答案