คำสั่ง Unix Basic

chown

Linux Command – chown ใช้ในเปลี่ยนเจ้าของ file หรือ directory รวมทั้ง file owner และ group owner

 

คำสั่ง

1. เปลี่ยนเจ้าของ file

chown <user> <filename>

$ ls -ltr test-rwx------ 1 root root 0 May 7 00:22 test$ chown games test$ ls -ltr test-rwx------ 1 games root 0 May 7 00:22 test

 

2. เปลี่ยน group เจ้าของ file

chown <:group> <filename>

$ ls -ltr test-rwx------ 1 games root 0 May 7 00:22 test$ chown :staff test$ ls -ltr test-rwx------ 1 games staff 0 May 7 00:22 test