Help us understand the problem. What is going on with this article?

Mac Catalina(10.15.3)のTerminal環境設定

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした