Tag Info

Hot answers tagged


The tilde character is expanded by the shell before the command is executed. It will be replaced by the value of $HOME. So the ln utility which creates the symlink will never see the tilde, only the full path. This path will be stored in the symlink. In Linux, there is no otion to make a symlink variable. They are handled by the kernel. The kernel does ...


-t specifies a directory in which to create a symlink. It doesn't specify a directory which is to be targeted by the symlink. What you want is ln -s gradle-2.7 gradle-current. This creates a symlink called "gradle-current" which points to "gradle-2.7". In actual fact it doesn't matter whether gradle-2.7 is a directory or a fileā€”the command is the same. ...


To address your question regarding symbolic links, "is ~ not allowed?". Answer : ~ is not allowed. It'll allow you to create such a symlink but it won't resolve to the home directory when followed. ln -s \~ d ls -ld d lrwxrwxrwx 1 steve steve 1 Sep 29 11:28 d -> ~ ls d d cd d cd: d: No such file or directory


Try using realpath: realpath --relative-to=/foo/bar/something /foo/hello/world For more examples, see: Convert absolute path into relative path given a current directory at SO

Only top voted, non community-wiki answers of a minimum length are eligible