Next: file commands stat, Up: file commands [Contents][Index]
Declare the commands required to retrieve informations about files and directories. Declaring the intention to use a program
The programs are: ls
, readlink
.
Execute ls
with pathname as argument.
Execute ls
with pathname as argument and the flag
-l
.
Make use of the readlink
to normalise the pathname of a
symbolic link (remember that a symbolic link references a file, never a
directory). Echo to stdout the normalised pathname.
The command line of readlink
is:
readlink -fn "$pathname"
Make use of readlink
to acquire the original pathname
referenced by pathname, then print it.
Raw executor for readlink
. The mandatory argument PATHNAME must be the pathname of
a directory entry. The optional arguments are added, as options, to the command line of
readlink
.
Next: file commands stat, Up: file commands [Contents][Index]