./和〜/之间的区别 [英] Difference between ./ and ~/

查看:133
本文介绍了./和〜/之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建文件路径和URL时,我注意到很多次该路径以./~/开头.

When creating filepaths and URLs, I noticed that many times the path starts with ./ or ~/.

./~/开头的文件路径有什么区别?

What is the difference between filepaths that start with ./ and ~/?

它们各自是什么意思?

推荐答案

./的意思是从当前目录开始". .指向当前工作目录,因此类似./foo.bar的东西将在当前目录中查找名为foo.bar的文件. (作为附带说明,..表示引用当前目录的父目录.因此../foo.bar将在上方一个目录中查找该文件.)

./ means "starting from the current directory". . refers to the current working directory, so something like ./foo.bar would be looking for a file called foo.bar in the current directory. (As a side note, .. means refers to the parent directory of the current directory. So ../foo.bar would be looking for that file one directory above.)

~/的意思是从主目录开始".在不同的情况下,这可能具有不同的含义.例如,在Unix环境中,~/foo.bar将在主目录中查找名为foo.bar的文件,例如/home/totzam/foo.bar.在许多Web应用程序中,~/foo.bar会在Web应用程序的根目录中查找名为foo.bar的文件,类似于/var/http/mywebapp/foo.bar.

~/ means "starting from the home directory". This could have different meanings in different scenarios. For example, in a Unix environment ~/foo.bar would be looking for a file called foo.bar in your home directory, something like /home/totzam/foo.bar. In many web applications, ~/foo.bar would be looking for a file called foo.bar in the web application root, something like /var/http/mywebapp/foo.bar.

这篇关于./和〜/之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆