Skip to content

Instantly share code, notes, and snippets.

@jonatanblue
Created April 26, 2017 13:34
Show Gist options
  • Select an option

  • Save jonatanblue/df0c82936bd5536300999b5a67d31644 to your computer and use it in GitHub Desktop.

Select an option

Save jonatanblue/df0c82936bd5536300999b5a67d31644 to your computer and use it in GitHub Desktop.

Revisions

  1. jonatanblue created this gist Apr 26, 2017.
    8 changes: 8 additions & 0 deletions sed_or_grep_a_stream.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # grep
    tail -f file | grep --line-buffered my_pattern

    # sed
    stdbuf -o0 tail -f /var/log/syslog | sed 's/Dec/LOOL/'

    # credits:
    # Thanks to @amblina for collecting these.