Oracle Solaris System Administration (MOSC)

MOSC Banner

Clarifications on chmod symlinks behavior

edited Apr 9, 2014 7:11AM in Oracle Solaris System Administration (MOSC) 2 commentsAnswered ✓

chmod(1) says:

-R
Recursively descend through directory arguments, setting
the  mode for each file. When symbolic links are encoun-
tered, the mode of the target file is  changed,  but  no
recursion takes place.

Take the following example (ll is ls -lh):

# ll -d /var/sample

lrwxrwxrwx   1 root     root          17 Apr  4 08:56 /var/sample -> /var/share/sample

# ll -d /var/share/sample

drwxr-xr-x   4 root     root           5 Apr  4 08:56 /var/share/sample

# ll /var/share/sample/*

-rw-r--r--   1 root     root           0 Apr  4 08:55 /var/share/sample/s1

/var/share/sample/a:

total 2

-rw-r--r--   1 root     root           0 Apr  4 08:56 a1

-rw-r--r--   1 root     root           0 Apr  4 08:56 a2

/var/share/sample/b:

total 1

-rw-r--r--   1 root     root           0 Apr  4 08:56 b1

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center