Windows10 grepをインストールして使用する手順
![Windows10 grepをインストールして使用する手順](https://mebee.info/wp-content/uploads/2019/10/windows.png)
linuxで利用できる便利なコマンドgrepをwindow10にインストールして、利用するまでの手順を記述してます。
環境
- OS windows10 pro 64bit
grepインストーラー
まずはこちらからインストーラーをダウンロードします。
最新の2.5.4をクリックします。
![](https://mebee.info/wp-content/uploads/2020/12/image-85-1024x438.png)
「grep-2.5.4-setup.exe」をクリックして最新バージョンをダウンロードします。
![](https://mebee.info/wp-content/uploads/2020/12/image-86-1024x537.png)
grepインストール
ダウンロードした「grep-2.5.4-setup.exe」を実行してインストールを開始します。
「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-76.png)
規約に同意して「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-77.png)
「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-78.png)
正常に動作させるため「Full installation」を選択して「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-79.png)
スタートメニューに登録するかどうかです。問題なければ「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-80.png)
「Next」をクリックします
![](https://mebee.info/wp-content/uploads/2020/12/image-81.png)
「Install」をクリックするとインストールが開始されます。
![](https://mebee.info/wp-content/uploads/2020/12/image-82.png)
「finish」をクリックするとインストールは完了です。
![](https://mebee.info/wp-content/uploads/2020/12/image-83.png)
PATHを追加
grep.exeは、今回は下記の場所にインストールしたので、 どこでも実行できるようにPATHを通します。
![](https://mebee.info/wp-content/uploads/2020/12/image-84.png)
PATHを通します。
![](https://mebee.info/wp-content/uploads/2020/04/windows-path-1.png)
grep実行
新しくコマンドプロンプトを起動すれば、grepが実行できるようになっていると思います。
grep --help
使用法: grep [オプション]‥‥ 文字列パターン [ファイル]‥‥
Search for PATTERN in each FILE or standard input.
PATTERN is, by default, a basic regular expression (BRE).
Example: grep -i 'hello world' menu.h main.c
Regexp selection and interpretation:
-E, --extended-regexp PATTERN is an extended regular expression (ERE)
-F, --fixed-strings PATTERN is a set of newline-separated fixed strings
-G, --basic-regexp PATTERN is a basic regular expression (BRE)
-P, --perl-regexp PATTERN is a Perl regular expression
-e, --regexp=PATTERN use PATTERN for matching
-f, --file=FILE obtain PATTERN from FILE
-i, --ignore-case ignore case distinctions
-w, --word-regexp force PATTERN to match only whole words
-x, --line-regexp force PATTERN to match only whole lines
-z, --null-data a data line ends in 0 byte, not newline
-
前の記事
Nuxt.js ライブラリ「@diracleo/vue-enlargeable-image」をインストールしてサムネイルから画像を拡大する 2020.12.15
-
次の記事
python 現在日時を取得する 2020.12.16
コメントを書く