grep

grep在线教程

类似传统的grep命令。

  1. USAGE:
  2. grep [-A <value>] [-B <value>] [-C <value>] [-h] [-i] [-v] [-n] [-m <value>] [-e] [--trim-end] pattern
  3. SUMMARY:
  4. grep command for pipes.
  5. EXAMPLES:
  6. sysprop | grep java
  7. sysprop | grep java -n
  8. sysenv | grep -v JAVA
  9. sysenv | grep -e "(?i)(JAVA|sun)" -m 3 -C 2
  10. sysenv | grep JAVA -A2 -B3
  11. thread | grep -m 10 -e "TIMED_WAITING|WAITING"
  12. WIKI:
  13. https://arthas.aliyun.com/doc/grep
  14. OPTIONS:
  15. -A, --after-context <value> Print NUM lines of trailing context)
  16. -B, --before-context <value> Print NUM lines of leading context)
  17. -C, --context <value> Print NUM lines of output context)
  18. -h, --help this help
  19. -i, --ignore-case Perform case insensitive matching. By default, grep is case sensitive.
  20. -v, --invert-match Select non-matching lines
  21. -n, --line-number Print line number with output lines
  22. -m, --max-count <value> stop after NUM selected lines)
  23. -e, --regex Enable regular expression to match
  24. --trim-end Remove whitespaces at the end of the line
  25. <pattern> Pattern