How To Include Comments With Grep?

Use `grep -v ‘^#’ file`

Use `grep -v ‘^[[:space:]]*#’ file`

Use `grep -v ‘^[[:space:]]*$’ file`

Use `grep -v -E ‘^[[:space:]]*(#|$)’ file`

Use `grep ‘pattern’ file`

Use `grep -n ‘pattern’ file`

Use `grep -i ‘pattern’ file`

Use `grep -r ‘pattern’ directory/`

Use `grep -v ‘^#’ file | grep ‘pattern’`

Use `grep -E ‘^[[:space:]]*[^#[:space:]]’ file`

Suggested for You

Trending Today