Monday, April 27, 2009

chown and chgrp

When use ``ls -l'' command it shows the owner and group of the directory.

markc@ubuntu-vm:/opt $ls -la
total 16
drwxr-xr-x 4 root root 4096 2009-04-27 11:04 .
drwxr-xr-x 25 root root 4096 2009-02-18 11:04 ..
drwxr-xr-x 7 root root 4096 2008-08-08 11:04 alp-dev
drwxr-xr-x 2 markc markc 4096 2009-04-27 11:04 work
^ ^
| |
chown chgrp


Here is the command (so I don't have to google it again) to change the directory "work"'s owner and group.


$ sudo chown markc work
$ sudo chgrp markc work