0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Macにインストールしたコマンド集

Last updated at Posted at 2022-09-20

はじめに

私のMacにインストールしたコマンド達を記録するだけのもの

wget

Httpアクセスして、コンテンツをダウンロードするコマンド

インストール目的

wget前提でインストール手順を書いていることがあるので。

インストール手順

$ brew install wget

コマンド例

$ wget http://ftp.gnu.org/gnu/wget/wget-1.18.tar.gz
--2022-09-20 21:48:24--  http://ftp.gnu.org/gnu/wget/wget-1.18.tar.gz
ftp.gnu.org (ftp.gnu.org) をDNSに問いあわせています... 2001:470:142:3::b, 209.51.188.20
ftp.gnu.org (ftp.gnu.org)|2001:470:142:3::b|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 3865525 (3.7M) [application/x-gzip]
`wget-1.18.tar.gz' に保存中

wget-1.18.tar.gz                 100%[========================================================>]   3.69M  1.14MB/s 時間 3.2s     

2022-09-20 21:48:28 (1.14 MB/s) - `wget-1.18.tar.gz' へ保存完了 [3865525/3865525]
$ ls -l wget-1.18.tar.gz 
-rw-r--r--  1 uedakeisuke  staff  3865525  6 10  2016 wget-1.18.tar.gz

md5sum

ハッシュ値をもとめるコマンド
同じ内容のファイルかどうかを確認するときに便利

インストール目的

findコマンドと組み合わせて、大量のファイルの中から同一ファイルを導き出す場面があった。

インストール手順

$ brew install md5sha1sum

コマンド例

$ md5sum test.html       
9d74162341751b6f6268749a80f7fa4f  test.html

sshpass

パスワードを引数に与え、パスワード認証sshを入力なしに行うコマンド

インストール目的

スクリプトの一連の中でパスワード認証のsshを行わなければならなかった為

インストール手順

$ wget https://sourceforge.net/projects/sshpass/files/latest/download/sshpass/1.08/sshpass-1.08.tar.gz
$ tar xvf sshpass-1.08.tar.gz
$ cd sshpass-1.08
$ ./configure
$ make
$ make install

コマンド例

$ sshpass -p password ssh guest@192.168.56.200
Last login: Mon Sep 12 20:47:59 2022

watch

引数で指定したコマンドの出力をリアルタイムに表示できるもの

インストール目的

リソースの状況をリアルタイムで確認したりする為

インストール手順

brew install watch

コマンド例

$ watch -d df -h

Every 2.0s: df -h          MBP.web.setting: Thu Sep 21 21:29:18 2022

Filesystem       Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk1s1s1  466Gi   24Gi  244Gi     9%  577694 2563440440    0%   /
devfs           190Ki  190Ki    0Bi   100%     658          0  100%   /dev
/dev/disk1s5    466Gi   20Ki  244Gi     1%       0 2563440440    0%   /System/Vo
lumes/VM
/dev/disk1s3    466Gi  605Mi  244Gi     1%    1796 2563440440    0%   /System/Vo
lumes/Preboot
/dev/disk1s6    466Gi  106Mi  244Gi     1%     448 2563440440    0%   /System/Vo
lumes/Update
/dev/disk1s2    466Gi  196Gi  244Gi    45% 1630838 2563440440    0%   /System/Vo
lumes/Data
map auto_home     0Bi    0Bi    0Bi   100%       0          0  100%   /System/Vo
lumes/Data/home
/dev/disk1s1    466Gi   24Gi  244Gi     9%  502070 2563440440    0%   /System/Vo
lumes/Update/mnt1

nodejs

サーバサイドjs

インストール目的

興味があった為

インストール手順

$ brew install node

typescript

型定義ができるjs

インストール目的

興味があった為

インストール手順

$ sudo npm init -y
$ sudo npm install --save-dev typescript@4.9.4

参考文献

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?