170 likes | 245 Views
Lecture 6: File Systems ( ch 4). IT244 - Introduction to Linux / Unix Instructor: Bo Sheng. Access Permissions. Execute permission on files Binary and script cp /home/shengbo/it244/binary . cp /home/shengbo/it244/script . ls – l (check the execute permission) cat binary cat script.
E N D
Lecture 6: File Systems (ch 4) IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Access Permissions • Execute permission on files • Binary and script • cp /home/shengbo/it244/binary . • cp /home/shengbo/it244/script . • ls –l(check the execute permission) • cat binary • cat script
Access Permissions • Execute permission on files • Binary and script • chmod a=x binary • ./binary
Access Permissions • Execute permission on files • Binary and script • chmod a=x script • ./script • chmod a=rx script
Access Permissions • Execute permission on files • Binary ( x ) • Script ( rx )
Access Control List • ACL: fine-grained access control • getfacl and setfacl • getfacl hello • setfacl –mu:shengbo:rw- hello • getfacl hello • setfacl –m u:shengbo:4 hello • getfacl hello
Access Control List • ACL: fine-grained access control • getfacl and setfacl • setfacl –m u:shengbo:rw-,u:yingmao:6 hello • getfacl hello • setfacl –x u:yingmao hello • getfacl hello
Links • Pointer to a file or directory
Links • Example • ls –l ~ • cd it244 • pwd
Links • Example • ls –l ~ / home courses username it244 it244 username
Links • Hard links and symbolic links • Hard links point to the actual data
Links • Hard links and symbolic links • Hard links point to the actual data • ln hello hello1 • ls -l • ls –i hello hello1 (inode number)
Links • Hard links and symbolic links • Hard links point to the actual data • cat hello hello1 • rm hello • cat hello1 • lnVS.cp • Hard links cannot point to directories
Links • Hard links and symbolic links • Symbolic (soft) links are shortcuts Hard link Symbolic link
Links • Hard links and symbolic links • Symbolic (soft) links are shortcuts • ln –s hello hello2 • ls -l • ls –i hello hello1 hello2
Links • Hard links and symbolic links • Symbolic (soft) links are shortcuts • cat hello hello1 hello2 • rm hello • cat hello1 • cat hello2 • echo hi > hello • cat hello hello1 hello2
Links • Hard links and symbolic links • Remove links • rm hello1