Louis I. answered 05/05/19
Computer Science Instructor/Tutor: Real World and Academia Experienced
This is a good question ... some utilities like basename or dirname might appear to be applicable here, but there are not. They work on the textual path value of a given file name, not at the file-system level.
Use the "readlink" command (with the -f option)
So for example:
$ for i in a*
> do
> readlink -f $i
> done
/home/lji/a1.awk
/home/lji/a2.awk
/home/lji/args.exe
/home/lji/args.exe.stackdump
/home/lji/arturo.mk
Here's the 1st line of the manual page for readlink
NAME
readlink - print resolved symbolic links or canonical file names