Fold open «Выбрать дополнительные параметры», выберите «Имя соответствует регулярному выражению» и нажмите кнопку «Добавить». Теперь вы можете заполнить регулярное выражение для соответствия. Чтобы использовать пример Joris, поместите [èö] в текстовое поле рядом с параметром поиска «Имя совпадает с регулярным выражением», который вы добавили, и он будет искать все файлы, содержащие è и / или ö. Вы можете добавить столько специальных символов, сколько хотите между []. О, и вы можете оставить основное окно поиска в верхней части пустого при поиске.
man по умолчанию уже использует less в качестве пейджера для отображения содержимого страницы руководства.
Теперь less уже имеет встроенную функцию поиска и выделения, поэтому вы не выполняете для этого нужен внешний инструмент, такой как grep.
Просто откройте manpage, запустив man sudo в оболочке, затем введите /-k (нажмите / и введите шаблон поиска). less теперь будет выделять везде, где это регулярное выражение совпадает в документе, а также сразу перейти к первому вхождению.
Затем вы можете перейти к следующему совпадению, набрав n (нажмите / ) или предыдущее совпадение, набрав N (нажмите Shift + N). [!d4 ]
Более общий, если вы хотите просмотреть вывод grep с яркой подсветкой в less, вы должны использовать grep --color=always (чтобы всегда излучать цветовые коды, даже если не выводить к терминалу, но к трубе) и less -R (для интерпретации цветовых экранов вместо печати управляющих символов):
man sudo | grep --color=always '\-k\|$' | less -R
Используйте переключатели grep -A, -B и -C, чтобы поймать окружающие линии
man grep | grep '\-[ABC]' -A2
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-C NUM, -NUM, --context=NUM
Print NUM lines of output context. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.
. В вашем случае:
man sudo | grep '\-k' -A5 -B2
Это, конечно, не идеально, поскольку вы не знаете, сколько строк необходимо, но оно все равно поможет вам найти то, что вам нужно.
Используйте переключатели grep -A, -B и -C, чтобы поймать окружающие линии
man grep | grep '\-[ABC]' -A2
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-C NUM, -NUM, --context=NUM
Print NUM lines of output context. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.
. В вашем случае:
man sudo | grep '\-k' -A5 -B2
Это, конечно, не идеально, поскольку вы не знаете, сколько строк необходимо, но оно все равно поможет вам найти то, что вам нужно.
Возможно, пейджер most удовлетворит ваши требования. Попробуйте
export PAGER=most
man sudo
/-k
Используйте переключатели grep -A, -B и -C, чтобы поймать окружающие линии
man grep | grep '\-[ABC]' -A2
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or
--only-matching option, this has no effect and a warning is given.
-C NUM, -NUM, --context=NUM
Print NUM lines of output context. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.
. В вашем случае:
man sudo | grep '\-k' -A5 -B2
Это, конечно, не идеально, поскольку вы не знаете, сколько строк необходимо, но оно все равно поможет вам найти то, что вам нужно.
Возможно, пейджер most удовлетворит ваши требования. Попробуйте
export PAGER=most
man sudo
/-k
Возможно, пейджер most удовлетворит ваши требования. Попробуйте
export PAGER=most
man sudo
/-k