• Wincent
    Open
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

Using Perl to filter standard inputEdit

Created 2/1/2016, updated 3/12/2020

Example: showing lines matching a regular expression

For those times when you want a full PCRE rather than just grep:

some_command|perl -ne 'print if /\bword\b/'

Note that you can also do this with ack or ag:

$ some_command|ack '\bword\b'
$ some_command|ag '\bword\b'

Related

  • Using Perl to filter standard input
  • perl.one.liners
  • ag
  • ack
  • wiki
Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell using React, Relay and GraphQL (with help from Git, Redis and Neovim).