Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created June 9, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/2901661 to your computer and use it in GitHub Desktop.
Save isaacs/2901661 to your computer and use it in GitHub Desktop.
$ mkdir -p a/b/c
$ ln -s a/b/c link
$ ls -laF | grep link
lrwxr-xr-x 1 isaacs staff 5 Jun 9 09:23 link@ -> a/b/c
drwxr-xr-x 3 isaacs staff 102 Jun 8 23:48 symlink-test/
$ (cd link/..; pwd -P)
/Users/isaacs/dev/js/node-master
$ node -pe 'require("fs").realpathSync("link/..")'
/Users/isaacs/dev/js/node-master
$ cd link
$ cd ..
$ pwd -P
/Users/isaacs/dev/js/node-master
$ pwd
/Users/isaacs/dev/js/node-master
$ ls -laF link/..
total 0
drwxr-xr-x 3 isaacs staff 102 Jun 9 09:23 ./
drwxr-xr-x 3 isaacs staff 102 Jun 9 09:23 ../
drwxr-xr-x 3 isaacs staff 102 Jun 9 09:24 c/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment