Что делает grep -w?

:set ff=dos
:w

ff/ fileformates "unix" por defecto, pero los terminadores CRLF se usan cuando es "dos" . Todos los finales de línea se cambiarán cuando se vuelva a escribir el archivo. Ver :help ffpara más advertencias y casos de esquina.

0
14.06.2019, 12:41
2 ответа

-w, --word-regexp Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.

Источник:https://linux.die.net/man/1/grep

1
28.01.2020, 02:30
# grep --help | grep -e -w
  -w, --word-regexp         force PATTERN to match only whole words
  -H, --with-filename       print file name with output lines
  -L, --files-without-match  print only names of FILEs with no selected lines
  -l, --files-with-matches  print only names of FILEs with selected lines
# grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu 18.04 LTS"
# man grep | grep -e -w -A1
       -w, --word-regexp
              Select only those lines containing matches that form whole words.  The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent  character.   Similarly,  it
              must be either at the end of the line or followed by a non-word constituent character.  Word-constituent characters are letters, digits, and the underscore.
2
28.01.2020, 02:30

Теги

Похожие вопросы