LoginSignup
2
1

More than 3 years have passed since last update.

Mac Catalina(10.15.3)のTerminal環境設定

Posted at

MacOS CatalinaのTerminal 初期読み込みファイルは~/.zshenv

MacOSのCatalinaでTerminal起動時のAlias設定読み込みで、ちょっとつまづいてしまったので、備忘の意味も込めて投稿しておきます。(ネットで探していたのですが、ちょっと苦労した。。)

以前のバージョン(どこまでのバージョンまでかは調べていないです)では、~/.bash_profile~/.bashrcを読み込む設定にすればよかったようですが、Catalinaは~/.zshenv~/.bash_profileと同じ設定を書き込んでおく必要がありました。

~/.bashrc
alias ll='ls -al'
~/.zshenv
if [ -f ~/.bashrc ] ; then
    . ~/.bashrc
fi

これでTerminalを起動し直せば、llls -laの結果を表示できます。

hoge@hoge-Mac ~ % ll
total 50
drwxr-xr-x+  36 hoge  staff   1152 Feb  9 16:26 .
-rw-rw-rw-    1 hoge  staff    402 Feb  4 05:38 .%5091FFA9.png
drwxr-xr-x    6 root          admin    192 Feb  4 05:38 ..
-rw-------    1 hoge  staff    208 Feb  9 14:19 .bash_history
-rw-r--r--    1 hoge  staff     62 Feb  9 09:58 .bash_profile
drwx------    9 hoge  staff    288 Feb  9 14:19 .bash_sessions
-rw-r--r--    1 hoge  staff     91 Feb  9 10:01 .bashrc
-rw-------    1 hoge  staff   7184 Feb  9 14:37 .zsh_history
-rw-r--r--    1 hoge  staff     62 Feb  9 14:19 .zshenv
drwx------@   3 hoge  staff     96 Feb  1 08:13 Applications
drwx------@   7 hoge  staff    224 Feb  9 16:40 Desktop
drwx------@   7 hoge  staff    224 Feb  9 16:49 Documents
drwx------@  15 hoge  staff    480 Feb  9 16:42 Downloads
drwx------@  65 hoge  staff   2080 Feb  6 06:17 Library
drwx------+   4 hoge  staff    128 Feb  1 20:14 Movies
drwx------+   4 hoge  staff    128 Feb  5 22:50 Music
drwx------+   5 hoge  staff    160 Feb  9 14:36 Pictures
drwxr-xr-x+   4 hoge  staff    128 Feb  1 08:06 Public
drwxr-xr-x   47 hoge  staff   1504 Feb  9 16:26 scriptlogs
.........

この設定だけで1時間以上、迷子になっていました。。。
I got lost...

2
1
1

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
2
1