Mac で truncate コマンドを使う

Mac で Homebrew の truncate をインストールしようとした。

環境:macOS Catalina Version 10.15.6(英語環境)

$ brew install truncate

上記コマンドを実行すると以下のように表示され、truncate コマンドは使えなくなっているようだ。

Error: truncate has been disabled because it has a removed upstream repository!

その場合、coreutils を使えばいい。

$ brew install coreutils

coreutils に gtruncate というコマンドが含まれており、truncate と同じように使える。truncate コマンドを使うところをそのまま gtruncate コマンドで置き換えればいい。

参考:
https://serverfault.com/questions/426652/install-ubuntu-truncate-command-to-mac-os-x-10-7


この記事が気に入ったらサポートをしてみませんか?