u(user)g(group) o(other)a(all)
su root
chmod g+w opt
ll(查看)
yyb@ubuntu:/$ su root
Password:
root@ubuntu:/# chmod o+w opt
root@ubuntu:/# ll
total 108
drwxr-xr-x 24 root root 4096 Dec 14 2017 ./
drwxr-xr-x 24 root root 4096 Dec 14 2017 ../
drwxr-xr-x 2 root root 4096 Jun 20 2018 bin/
drwxr-xr-x 3 root root 4096 Dec 14 2017 boot/
drwxrwxr-x 2 root root 4096 Dec 14 2017 cdrom/
drwxr-xr-x 19 root root 4360 Feb 4 17:11 dev/
drwxr-xr-x 138 root root 12288 Feb 3 18:03 etc/
drwxr-xr-x 3 root root 4096 Dec 14 2017 home/
lrwxrwxrwx 1 root root 32 Dec 14 2017 initrd.img -> boot/initrd.img-4.4.0-21-generic
drwxr-xr-x 22 root root 4096 Dec 14 2017 lib/
drwxr-xr-x 2 root root 4096 Apr 20 2016 lib64/
drwx------ 2 root root 16384 Dec 15 2017 lost+found/
drwxr-xr-x 5 root root 4096 Dec 14 2017 media/
drwxr-xr-x 3 root root 4096 Dec 14 2017 mnt/
drwxr-xrwx 5 root root 4096 Feb 3 05:12 opt/
dr-xr-xr-x 296 root root 0 Feb 4 17:11 proc/
drwx------ 17 root root 4096 Feb 3 19:23 root/
drwxr-xr-x 26 root root 780 Feb 4 17:11 run/
drwxr-xr-x 2 root root 12288 Feb 2 20:22 sbin/
drwxr-xr-x 2 root root 4096 Apr 19 2016 snap/
drwxr-xr-x 2 root root 4096 Apr 20 2016 srv/
dr-xr-xr-x 13 root root 0 Feb 4 17:24 sys/
drwxrwxrwt 12 root root 4096 Feb 4 17:23 tmp/
drwxr-xr-x 11 root root 4096 Apr 20 2016 usr/
drwxr-xr-x 14 root root 4096 Apr 20 2016 var/
lrwxrwxrwx 1 root root 29 Dec 14 2017 vmlinuz -> boot/vmlinuz-4.4.0-21-generic
root@ubuntu:/# chmod g+w opt
root@ubuntu:/# ll
total 108
drwxr-xr-x 24 root root 4096 Dec 14 2017 ./
drwxr-xr-x 24 root root 4096 Dec 14 2017 ../
drwxr-xr-x 2 root root 4096 Jun 20 2018 bin/
drwxr-xr-x 3 root root 4096 Dec 14 2017 boot/
drwxrwxr-x 2 root root 4096 Dec 14 2017 cdrom/
drwxr-xr-x 19 root root 4360 Feb 4 17:11 dev/
drwxr-xr-x 138 root root 12288 Feb 3 18:03 etc/
drwxr-xr-x 3 root root 4096 Dec 14 2017 home/
lrwxrwxrwx 1 root root 32 Dec 14 2017 initrd.img -> boot/initrd.img-4.4.0-21-generic
drwxr-xr-x 22 root root 4096 Dec 14 2017 lib/
drwxr-xr-x 2 root root 4096 Apr 20 2016 lib64/
drwx------ 2 root root 16384 Dec 15 2017 lost+found/
drwxr-xr-x 5 root root 4096 Dec 14 2017 media/
drwxr-xr-x 3 root root 4096 Dec 14 2017 mnt/
drwxrwxrwx 5 root root 4096 Feb 3 05:12 opt/
dr-xr-xr-x 296 root root 0 Feb 4 17:11 proc/
drwx------ 17 root root 4096 Feb 3 19:23 root/
drwxr-xr-x 26 root root 780 Feb 4 17:11 run/
drwxr-xr-x 2 root root 12288 Feb 2 20:22 sbin/
drwxr-xr-x 2 root root 4096 Apr 19 2016 snap/
drwxr-xr-x 2 root root 4096 Apr 20 2016 srv/
dr-xr-xr-x 13 root root 0 Feb 4 17:24 sys/
drwxrwxrwt 12 root root 4096 Feb 4 17:23 tmp/
drwxr-xr-x 11 root root 4096 Apr 20 2016 usr/
drwxr-xr-x 14 root root 4096 Apr 20 2016 var/
lrwxrwxrwx 1 root root 29 Dec 14 2017 vmlinuz -> boot/vmlinuz-4.4.0-21-generic
root@ubuntu:/#