...
Examples:
ls -l ~/haiku.txt
haiku.txt | description |
---|
Image Modified | - dash ( - ) in position one signifies this is a regular file
rw- for owner allows read and write accessr-- for group permits only read access--- for everyone means no access allowed
|
ls -l /usr/bin/ls
/usr/bin/ls
| description |
---|
Image Modified | - /usr/bin/ls is the program that performs the ls command
- root (the master admin account) is the owner, in the root group
- dash ( - ) in position one signifies this is a regular file
rwx for owner allows read, write and executer-x for group permits read and executer-x for everyone permits read and execute
|
ls -ld ~/docs (-d says to list directory information, not directory contents)
docs
| description |
---|
Image Modified | d in position one signifies this is a directoryrwx for owner allows read, write and "execute" (list for directories)r-x for group permits read and "execute" (list)--- for everyone means no access allowed
|
Exercise 4-3
What are the directory permissions and ownership of /stor/work/CBRS_unix/test? Can you list its contents? Why or why not?
Expand |
---|
|
Use ls -ld /stor/work/CBRS_unix/test to see just that directory's long listing. |
Expand |
---|
|
ls -ld /stor/work/CBRS_unix/test shows the permissions of that directory are drwxr-x--- and it is owned by user abattenh in the CCBB_Workshops_1 group. Because group permissions are r-x anyone in our CCBB_Workshops_1 group can access that directory, but cannot add/delete files in it because there are no group write permissions. So ls -l /stor/work/CBRS_unix/test successfully lists the directory's contents. |
What are the directory permissions and ownership of /stor/work/CBRS_unix/test/anna_only? Can you list its contents? Why or why not?
Expand |
---|
|
ls -l /stor/work/CBRS_unix/test -or- ls -ld /stor/work/CBRS_unix/test/anna_only shows the permissions of the anna_only directory are drwx------ and it is owned by user abattenh in the CCBB_Workshops_1 group. Because group permissions are --- no one in our CCBB_Workshops_1 group can access that directory. So ls -l /stor/work/CBRS_unix/test/anna_only reports a Permission denied error. |