Добавить
Уведомления

Edit the Terminal Prompt name | MacOS Terminal Name Change

Change your terminal prompt name on mac - By default your terminal prompt name is in the format before the $ sign like this - HOST_NAME:USER_NAME CURRENT_DIRECTORY $ Now if I want to rename it - export PS1="TechMantra$ " How to rename completely - Open up a new Terminal window and type the command $ cd ~/ This will ensure you’re in your User Home directory. Type ls -a to show the contents of your Home directory and check if a .bash_profile exists. If it doesn't exist, you will have to create the same using $ touch .bash_profile Then edit the file using $ open -e .bash_profile or $ vi .bash_profile Then append export PS1="\u$ " The \u flag sets the prompt to your User name. After committing this file, you'll have to relaunch the terminal. The other available options are - \d – Current date \t – Current time \h – Host name \# – Command number \u – User name \W – Current working directory (ie: Desktop/) \w – Current working directory with full path (ie: /Users/Admin/Desktop/)

12+
14 просмотров
2 года назад
21 февраля 2024 г.
12+
14 просмотров
2 года назад
21 февраля 2024 г.

Change your terminal prompt name on mac - By default your terminal prompt name is in the format before the $ sign like this - HOST_NAME:USER_NAME CURRENT_DIRECTORY $ Now if I want to rename it - export PS1="TechMantra$ " How to rename completely - Open up a new Terminal window and type the command $ cd ~/ This will ensure you’re in your User Home directory. Type ls -a to show the contents of your Home directory and check if a .bash_profile exists. If it doesn't exist, you will have to create the same using $ touch .bash_profile Then edit the file using $ open -e .bash_profile or $ vi .bash_profile Then append export PS1="\u$ " The \u flag sets the prompt to your User name. After committing this file, you'll have to relaunch the terminal. The other available options are - \d – Current date \t – Current time \h – Host name \# – Command number \u – User name \W – Current working directory (ie: Desktop/) \w – Current working directory with full path (ie: /Users/Admin/Desktop/)

, чтобы оставлять комментарии