简体   繁体   中英

simple relative path question

在相对路径中, 〜/ directory / subdirectory./directory/subdirectory有什么区别

In Linux, ~ is your home directory, while . is the current directory, so those pathes are the same when you are in your home directory (since . is ~ ), but not in other cases.

~/directory/subdirectory refers to subdirectory folder inside directory folder, inside your home folder.

./directory/subdirectory refers to subdirectory folder inside directory folder, inside current execution folder.

~/directory/subdirectory for any particular user, is an absolute path instead. It referes to "directory/subdirectory" inside the user's home directory.

./directory/subdirectory is a relative path. It referes to "directory/subdirectory" inside the current directory (output of pwd command).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM