LoginSignup
1
0

More than 3 years have passed since last update.

Centosでbat(バッチではない)を使う。

Last updated at Posted at 2021-01-20

batというcatコマンドをよりモダンにしたものがあります。
公式Github
これをCentosにインストールする方法がわかりにくかったのでメモ。

ダウンロード

リリースページの最新版からお使いの環境のものをダウンロード。
私はbat-v0.17.1-x86_64-unknown-linux-musl.tar.gzをダウンロードしました。
intel 64bitのCentOSならこれでいいと思います。

インストール

wget -O bat.zip https://github.com/sharkdp/bat/releases/download/v0.17.1/bat-v0.17.1-x86_64-unknown-linux-musl.tar.gz

tar -xvzf bat.zip -C /usr/local

cd /usr/local && mv bat-v0.17.1-x86_64-unknown-linux-musl bat

cd ~

alias bat="/usr/local/bat/bat" #エイリアスの追加

使い方

$ bat test.txt

これで使えます。catコマンドと同じですね。
他にも他のコマンドと合わせて使う方法などがあるので公式の日本語ページが参考になると思います。

参考文献

batを教えてくれた記事
https://qiita.com/navitime_tech/items/c249269a3b47666c784b

公式Github
https://github.com/sharkdp/bat

issues325
https://github.com/sharkdp/bat/issues/325

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0