Linux stream commands

  1. wc
    • -c count characters
    • -w count words
    • -l count lines
    • -L print the length of the longest line
  2. grep
    • -i => matching is case insensitive
    • -E => use regular expression
    • -n => include line numbers in output
    • -v => include lines that do not include the following words
    • -B <integer> => include <integer> lines before searched term
  3. sed
    • sed 's/find/replace/' => replaces first intance of find with replace
    • sed 's/find/replace/g' => replaces all instances of find with replace.
  4. tr
    • tr <options> <set1> <set2>
    • replaces set1 with set2.

    • -d => deletes set1
    • -s => squeeze, remove duplicate letters included in set1
  5. sort
    • sort <options> filename . . .
    • -n => sort numericaly
    • -r => sort in reverse order
    • -m => do not sort, only merge
    • -t <separator> => use the character separator as a column separator
    • -k <number> => sort by this column number
    • -o <filename> => send output to this file instead of STDOUT
  6. uniq
    • uniq <options> <filename. . .>
    • must be fed sorted data
    • -i => ignore case
    • -D => print duplicate lines
    • -d => only print duplicate lines
    • -u => only print unique lines
    • -c => prefix lines by the number of occurrences
Author
Svenxix
ID
100900
Card Set
Linux stream commands
Description
Basic linux command line options for stream control commands
Updated