如何创建符号链接,但cd应显示物理目录名称

时间:2015-09-27 01:35:00

标签: linux ln

我的主目录中有一个名为〜/ bestphotosever

的文件夹

所以我按如下方式创建一个符号链接:

cd ~
ln -s bestphotosever bpe
cd bpe
pwd
#-- here is what pwd shows
--> /home/myuser/bpe

#What I would like it to show is the physical name
--> /home/myuser/bestphotosever

任何想法如何使用'ln'命令执行此操作。

1 个答案:

答案 0 :(得分:2)

你可以使用" pwd -P"相反,避免所有符号链接并打印"真实"路径

编辑:我刚才意识到我可能没有回答你的问题。

你确定"你想要"一个硬链接? 关于硬链接与符号链接的一些信息。 https://askubuntu.com/questions/210741/why-are-hard-links-not-allowed-for-directories

如果您只想进入名称较短的文件夹,则tabcompletion或别名是您的朋友。

相关问题