Команда fgrep: опции, ключи и примеры использования
fgrep
Matches patterns in files. Supports simple patterns and regular expressions.
- Search for an exact string in a file:
fgrep {{search_string}} {{path/to/file}}
- Search only lines that match entirely in files:
fgrep -x {{path/to/file1}} {{path/to/file2}}
- Count the number of lines that match the given string in a file:
fgrep -c {{search_string}} {{path/to/file}}
- Show the line number in the file along with the line matched:
fgrep -n {{search_string}} {{path/to/file}}
- Display all lines except those that contain the given regular expression:
fgrep -v {{^regex$}} {{path/to/file}}
- Display filenames whose content matches the regular expression at least once:
fgrep -l {{^regex$}} {{path/to/file1}} {{path/to/file2}}
- 25 января вышло новое крупное обновление Age of Empires II DE: Lords of the West
- И снова sudo, и снова "решето"
- Только одна из десяти компаний ожидает, что все работники вернутся в офисы
- Google Play временно забанил видео-плеер за поддержку неправильных субтитров
- Google прекращает поддержку сторонних приложений в API Chrome-like