3

On one of our servers, we have a directory with the following path:

"/daten/i/scripts"

When you go to /daten/i, one can see that scripts is a soft link to "/batch".

When I type cd /daten/i/scripts and then pwd, I see /daten/i/scripts.

Is there a way, a command, that I can type in at /daten/i/scripts that shows me that I'm in a "soft link", that I am really in /batch?

1
  • If I'm not mistaken, the -L flag to pwd should help.
    – schaiba
    Sep 19, 2016 at 9:09

1 Answer 1

3

Yes, pwd has -P (--physical) option to avoid all symlinks.

So do:

pwd -P

or you can use the canonical way, readlink:

readlink -f /path

Check man pwd and man readlink.

1
  • man pwd says "-P, --physical - avoid all symlinks"
    – schaiba
    Sep 19, 2016 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.