4,461
edits
Comparison with Linux commands Tag: visualeditor |
|||
Line 31: | Line 31: | ||
|+ | |+ | ||
!Action | !Action | ||
!Linux | |||
!PowerShell | !PowerShell | ||
|- | |- | ||
|Search for a string | |Search for a string 1 | ||
|<nowiki>az keyvault list | | |<code><nowiki>az keyvault list | grep -i 'name";'</nowiki></code> | ||
|<nowiki>az | |<code><nowiki>az keyvault list | findstr -i 'name":'</nowiki></code> | ||
|- | |||
|Search for a string 2 - current folder and subfolders | |||
|<code><nowiki>find . | xargs grep -si "searchtext"</nowiki></code> | |||
|<code><nowiki>Get-ChildItem -Path "." -Recurse -File | Select-String -Pattern "searchtext"</nowiki></code> | |||
|- | |||
|Search for a string 3 - only list names of files | |||
|<code><nowiki>find . | xargs grep -sil "searchtext"</nowiki></code> | |||
|<code><nowiki>Get-ChildItem -Path "." -Recurse -File | Select-String -Pattern "searchtext" -List | Select-Object -Property Path</nowiki></code> | |||
|- | |- | ||
|Alias a command | |Alias a command | ||
| | |<code>alias g grep</code> | ||
|alias | |<code>new-alias grep findstr</code> | ||
|} | |} |