-
Notifications
You must be signed in to change notification settings - Fork 0
/
chown.txt
15 lines (11 loc) · 895 Bytes
/
chown.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# when \e[38;5;226mchown -R <name>:<name> target\e[0m runs on a symlink it does NOT recurse, you need to add a trailing slash after the target:
$ chown -R <name>:<name> target\e[32;1m/\e[0m
# chmod -R on a symlink does \e[1mnot\e[0m require a trailing slash, and seems to make no difference.
\e[1;36mSymlinks\e[0m
# chown on a symlink affects the file the symlink points to, you can use \e[38;5;208m-h\e[0m for the link itself.
# it does \e[1mnot follow symlinks inside\e[0m a target directory though, for that you'll need \e[38;5;208mfind -L $dir exec chown user:user {} +\e[0m
# chmod on a symlink \e[1monly\e[0m affects the file the symlink points to. The perms on the link itself are always 777, per man page:
"the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links
are never used."
# remove sticky bits
$ chmod -t foo