Mac
GNU core utilities(coreutils)の例
- ターミナルを開く
- Homebrewをインストールする
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- 「You have not agreed to the Xcode license. Before running the installer again please agree to the license by opening
Xcode.app or running:」というメッセージが出たら以下を実行し、使用許諾書が表示されたらagreeとタイプ
$ sudo xcodebuild -license
- coreutilsをインストールする
$ brew install coreutils
- ターミナルで以下がエラー無く実行できればOK
$ gls
MacにはデフォルトでBSD系のコマンドが入っているため、区別するためにcoreutilsのコマンドは頭にgをつけた名前となっています
したがってls
はgls
となります
Win
Gnu On Windows(Gow)の例
- Gowから最新バージョンのインストーラ(例:Gow-0.8.0.exe)をダウンロードし、ダブルクリックしてインストール (こだわりがなければすべてデフォルトでOK。勝手にパスも通してくれます)
- コマンドプロンプトを起動し、以下がエラー無く実行できればOK
$ ls
Dockerを使う
- UbuntuなどのDockerを使うのも手っ取り早いです
- busyboxは入っているコマンドが限られるので注意
-
シェル芸勉強会用にalpineにbashを入れたDockerイメージを公開しています→ emihat/bioshellenv
- Qiita: Windowsで使えるターミナルとシェルのまとめ