Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
pwd给出当前目录的绝对路径。有没有办法给出相对于当前目录的目录的绝对路径?(诚然,这几乎没有问题。)
pwd
普通密码:
[/x/y/z]$ pwd /x/y/z
相对可能是:
[/x/y/z]$ pwd ../a/b /x/y/a/b
根据您对目录的问题,您想要绝对的。使用真实路径命令:
realpath ../a/b
将输出绝对路径./x/y/a/b
相对路径是你给的。../a/b
I'm developing a program which is able to find the difference in files between to folders for instance. I've made a method which traverses the folder structure of a given folder, and builds a tree for each subfolder