タグ

ブックマーク / tex2e.github.io (1)

  • PowerShellでgrep (Select-String) を使う

    PowerShellでgrepするには、Select-String (sls) コマンドレットを使います。 grep -r (ディレクトリ下を再帰的に検索) Linux でディレクトリ下を再帰的ファイル内から文字列を検索するときは grep -r 'REGEX' . を実行しますが、同じことを PowerShell で実行したい場合は Get-ChildItem (dir) と Select-String を組み合わせて検索します。 Get-ChildItem -Recurse | Select-String -Pattern "REGEX" PowerShellで再帰的に検索するときに、特定のファイル形式のみを抽出するには -Filter オプションを使用します。 Get-ChildItem -Recurse -Filter "*.java" | Select-String -Patte

    PowerShellでgrep (Select-String) を使う
  • 1