Home  >  Q&A  >  body text

linux - "~#" 和 "/#"的区别是什么?

高洛峰高洛峰2743 days ago916

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 14:19:42

    / represents the root node /
    ~ represents home
    if logged in with root account
    ~ represents /root/ directory
    if logged in with user name
    ~ represents /home/name/


    When you log in with the root account
    by default you enter the /root directory.
    When you #cd .. you enter the / root directory.
    When you #cd ~ in any environment, you will enter the /root directory

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:19:42

    (Assuming you haven’t learned how to change shell and PS1 yet)

    / and ~ are the current working directory. ~ represents the current user’s home directory

    # means that your current user is root. If it is a normal user, it will display $.

    reply
    0
  • Cancelreply