Skip to main content

chown/chgrp für Symlinks

für das Ändern des Besitzer oder der Gruppe eines Symlinks gibts einen speziellen Parameter für chown oder chgrp.

Mit -h oder –no-dereference läßt sich einschalten, dass direkt der Symlink angefasst werden soll anstatt der referenzierten Datei:

# cd /var/lib/mailman
# ls -l

total 24K
lrwxrwxrwx   1 root root   24 May 19 16:40 Mailman -> /usr/lib/mailman/Mailman
drwxrwsr-x   4 list list 4.0K May 19 16:40 archives
lrwxrwxrwx   1 root root   20 May 19 16:40 bin -> /usr/lib/mailman/bin
lrwxrwxrwx   1 root root   24 May 19 16:40 cgi-bin -> /usr/lib/cgi-bin/mailman
lrwxrwxrwx   1 root root   21 May 19 16:40 cron -> /usr/lib/mailman/cron
drwxrwsr-x   2 list list 4.0K Jun 17 10:40 data
lrwxrwxrwx   1 root root   25 May 19 16:40 icons -> /usr/share/images/mailman
drwxrwsr-x 128 list list 4.0K Jun 17 10:38 lists
lrwxrwxrwx   1 root root   17 May 19 16:40 locks -> /var/lock/mailman
lrwxrwxrwx   1 root root   16 May 19 16:40 logs -> /var/log/mailman
lrwxrwxrwx   1 root root   21 May 19 16:40 mail -> /usr/lib/mailman/mail
drwxrwsr-x  38 list list 4.0K May 19 16:40 messages
drwxrwsr-x   2 list list 4.0K Feb 16 21:14 qfiles
lrwxrwxrwx   1 root root   24 May 19 16:40 scripts -> /usr/lib/mailman/scripts
drwxrwsr-x   2 list list 4.0K Feb 16 21:14 spam
lrwxrwxrwx   1 root root   12 May 19 16:40 templates -> /etc/mailman

# chgrp -h list *
# ls -l

total 24K
lrwxrwxrwx   1 root list   24 May 19 16:40 Mailman -> /usr/lib/mailman/Mailman
drwxrwsr-x   4 list list 4.0K May 19 16:40 archives
lrwxrwxrwx   1 root list   20 May 19 16:40 bin -> /usr/lib/mailman/bin
lrwxrwxrwx   1 root list   24 May 19 16:40 cgi-bin -> /usr/lib/cgi-bin/mailman
lrwxrwxrwx   1 root list   21 May 19 16:40 cron -> /usr/lib/mailman/cron
drwxrwsr-x   2 list list 4.0K Jun 17 10:40 data
lrwxrwxrwx   1 root list   25 May 19 16:40 icons -> /usr/share/images/mailman
drwxrwsr-x 128 list list 4.0K Jun 17 10:38 lists
lrwxrwxrwx   1 root list   17 May 19 16:40 locks -> /var/lock/mailman
lrwxrwxrwx   1 root list   16 May 19 16:40 logs -> /var/log/mailman
lrwxrwxrwx   1 root list   21 May 19 16:40 mail -> /usr/lib/mailman/mail
drwxrwsr-x  38 list list 4.0K May 19 16:40 messages
drwxrwsr-x   2 list list 4.0K Feb 16 21:14 qfiles
lrwxrwxrwx   1 root list   24 May 19 16:40 scripts -> /usr/lib/mailman/scripts
drwxrwsr-x   2 list list 4.0K Feb 16 21:14 spam
lrwxrwxrwx   1 root list   12 May 19 16:40 templates -> /etc/mailman