0
1

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 5 years have passed since last update.

Macターミナルで $ の前のコンピュータ名、ユーザ名を非表示にする

Posted at

Macターミナルで $ の前のコンピュータ名、ユーザ名を非表示にして、ディレクトリ名と$マークのみに変更する。

# .bash_profile を開く
vi ~/.bash_profile 

# .bash_profile に追記
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

# .bashrc を開く
vi ~/.bashrc 

# .bashrc に追記。今いるディレクトリ名と$マークのみが表示されるように設定。
PS1="\W $ "

以上で、ターミナルを再起動すると、変更が反映される。

参考

https://tech.qookie.jp/posts/terminal-turn-off-prompt/
https://www.webdesignleaves.com/pr/plugins/mac_terminal_basics_01.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?