Differences between linux commands su and su-

Source: Internet
Author: User

The biggest essential difference between the su command and the su-command is that su only switches the root identity, but the Shell environment is still the Shell of ordinary users; the su-connected user and the Shell environment are switched to the root identity. The PATH environment variable error does not occur only when the Shell environment is switched. After su is switched to the root user, pwd finds that the working directory is still the working directory of normal users. After su-command is switched, the working directory is changed to the root working directory. Run the echo $ PATH command to check whether the environment variables after su and su are different. Similarly, to switch from the current user to another user, use the su-command.

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.