Select-String в PowerShell

Содержание
Пример
Context: показать соседей
Похожие статьи

Пример

Получить список строк файла, удовлетворяющих условию

Select-String -Pattern "Result" -Path .\README.md

README.md:32:#### Results: README.md:34:Result Load README.md:36:Result Database

Выбрать подходящие строки можно и из стандартного вывода

cat .\README.md | Select-String -Pattern "Result"

#### Results: Result Load Result Database

Context

Опция -Context позволяет изучить заданное количество строк до/после найденного совпадения.

Get-Alias | Select-String -Pattern "tee" -Context 2

sv swmi > tee trcm type

Article author: Andrei Olegovich

Похожие статьи
Windows
PowerShell
Install
Basics
Alias
Functions
Network
Users
Files
REST API requests
Errors

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: