The prompt text environment variable PS1 of the mac terminal is the prompt text format of the terminal. The default value is \ h: \ W \ u \ $. You can use echo to view the prompt text: echo $ PS1 www.2cto.com PS2 is the prompt after the line break, the default is "> ". Some of the formats available are ): \ d-current system date \ t-current system time \ h-Host Name \ #-command Number (Comannd Number) \ u-USERNAME \ W-current path \ w-current complete path. If you only want to display the command number, enter the following command: PS1 = "\#: "changed to Linux style and run: PS1 =" [\ u @ \ h \ W] \ $ ". However, after exiting, these environment variables are lost. To take effect permanently, you can ~ /. Bash_profile ,~ /. Bash_login ,~ /. Profile or/etc/profile (Administrator permission required). Set echo 'ps1 = "[\ u @ \ h \ W] \ $" '> ~ /. If you want to modify the host name for bash_profile, you can open "share" in "system preference settings" and edit the computer name. --------------------------------------------------------------------- PS1 = "$ c2 \ W $ c3 (\ $ (~ /. Rvm/bin/rvm-prompt v g) $ c1 \ $ (parse_git_branch) $ c_1 $ "$ echo '[[-s" $ HOME /. rvm/scripts/rvm "] &. "$ HOME /. rvm/scripts/rvm "# This loads RVM into a shell session. '> ~ /. Bash_profile