z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Command differences with symbolic links

z/OS UNIX System Services User's Guide
SA23-2279-00

Certain directories like /etc, /dev, /tmp, and /var are converted to symbolic links. Some shell commands have minor technical differences when they refer to symbolic links instead of regular files or directories. For example, ls does not follow symbolic links by default.

In order to follow symbolic links, you must specify ls -L or provide a trailing slash. For example, ls -L /etc and ls /etc/ both display the files in the directory that the /etc symbolic link points to.

Other shell commands that have differences due to symbolic links are du, find, pax, rm and tar.

While these behavioral changes should be minor, users can tailor command defaults by creating aliases for the shell command. For example, if you want ls to follow symbolic links, you could issue the command alias ls="ls -L". Aliases are typically defined in the users' ENV file.
Note: After this alias has been established, ls will follow all symbolic links.

An administrator can put alias commands in /etc/profile that could affect all users' login shells. IBM® does not recommend this, because changing the default behavior in /etc/profile may produce unexpected results in shell scripts or by shell users.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014