Solution: show only-bash-4.1 in shell command line # Do not show users and paths

Source: Internet
Author: User

Solution: show only-bash-4.1 in shell command line # Do not show users and paths
Today, I accidentally typed the home Directory deletion command. Although it was not deleted for various reasons, many files and directories in the home directory were deleted, the command line does not display the current user and path. Next, you need to set two files for resetting :~ /. Bashrc and ~ /. Bash_profile1. Create a. bashrc file in the current directory: # touch ~ /. Bashrc # vim ~ /. Bashrc and enter the following data #. bashrc # Source global definitionsif [-f/etc/bashrc]; then. /etc/bashrcfi # User specific aliases and functionssource to take effect: # source ~ /. Bashrc2. bash_profile: Create the. bash_profile file in the current directory: # touch ~ /. Bash_profile # vim ~ /. Bash_profile and enter the following data #. bash_profile # Get the aliases and functionsif [-f ~ /. Bashrc]; then .~ /. Make bashrcfisource take effect below: # source ~ /. Bash_profile: You can see that the current user and path are successfully displayed. ============ Gorgeous split line ============== if you have these two directories, but it still shows-bash-4.1 #. You can refer to the following solution (this solution is taken from the Internet for verification) steps: vim ~ /. Bash_profile (ignore. there are several bash_profile files, and you can create one by yourself.) add export PS1 = '[\ u @ \ h \ W] \ $' at the end and then execute source ~ /. Bash_profile so that the shell can display the path.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.