Hacker News new | ask | show | jobs
by kleff 3202 days ago
Never knew about readlink for files, but I use

  pwd -P 
all the time to get the real full path (no symlinks) of the current directory. Really easy to remember as well, Print Working Directory.
1 comments

That is not the same use case.

You could use this to get the current location of the script being run (not the location where it runs).

   readlink -f $0