1 / 26

Lecture 5: File Systems ( ch 4)

Lecture 5: File Systems ( ch 4). IT244 - Introduction to Linux / Unix Instructor: Bo Sheng. Outline. Filename and paths Directory operations Access permissions . Filenames and Paths. Absolute path name ls /home/it244/it244 ls /home/it244/it244/. /home/it244/it244/hello. Path.

monifa
Download Presentation

Lecture 5: File Systems ( ch 4)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 5: File Systems (ch 4) IT244 - Introduction to Linux / Unix Instructor: Bo Sheng

  2. Outline • Filename and paths • Directory operations • Access permissions

  3. Filenames and Paths • Absolute path name • ls /home/it244/it244 • ls /home/it244/it244/ /home/it244/it244/hello Path Filename

  4. Filenames and Paths • Absolute path name

  5. Filenames and Paths • Absolute path name • ~ represents “home directory” • ls ~ =ls /home/your username • cd ~ • pwd • ls ~it244 =ls /home/it244

  6. Filenames and Paths • Relative path name • cd /home/it244 • ls it244 /home/it244/it244/hello Path Filename

  7. Filenames and Paths • Relative path name • . : Current directory • .. :Parent directory • ls –la • ls . • ls .. • cd .. • cd ../..

  8. Filenames and Paths • Relative path name

  9. Filenames and Paths • Standard directories (Pg95~98)

  10. Directory Operations • Create a directory • mkdir book • ls -l • ls book • ls ./book • cd book • ls ../book

  11. Directory Operations • Delete a directory (when it’s empty) • cd .. • rmdir book • Example • mkdir book • cd book • echo “this is a book” > book1 • cd .. • rmdir book (not empty)

  12. Directory Operations • Example • rm book/book1 • rmdir book • Delete directories by rm • mkdir book • rm book • rm –r book (cautious)

  13. Directory Operations • Example • mkdir book • cd book • mkdir novel • cd .. • rmdir book • cd book/novel • rmdir .

  14. Directory Operations • Copy and move files to directories • cd ../.. • cp hello book • ls book • mv welcome linux book • ls • ls book

  15. Directory Operations • Copy and move files to directories • mv book newbook • mv newbook book • ls • mkdirnewbook • mv book newbook

  16. Directory Operations • Copy and move files to directories • mv newbook/book book • cp book newbook ??? • cp –r book newbook • lsnewbook

  17. Access Permissions • Three types of users • Owner • Group member • Others • Three access permissions • Read • Write • Execute

  18. Access Permissions

  19. Access Permissions • Change access permissions (chmod) • Symbolic arguments • a (all), u (owner), g (group), o (others) • r (read), w (write), x (execute) • + / - • chmoda+w book1 • chmod go-rw book1

  20. Access Permissions • Change access permissions (chmod) • Numeric arguments -rw-r--r-- 644 -rwxr-xr-x 755

  21. Access Permissions • Change access permissions (chmod) • Numeric arguments • chmod 644 book1 • chmod 755 book1

  22. Access Permissions • Example • Read permission • chmod a-r hello • cat hello • chmoda+r hello • cat hello

  23. Access Permissions • Example • Read permission • chmod a-r book • ls book • ls book/book1 • chmoda+r book

  24. Access Permissions • Example • Write permission • chmod a-w hello • echo hi>hello • rm hello • chmoda+w hello • rm hello

  25. Access Permissions • Example • Write permission • cd book • chmod a-w . • chmoda+rw book1 • echo hi>book2 (create a file) • mv book1 book2 (rename a file) • rm book1 (delete a file) • chmoda+w .

  26. Access Permissions • Example • Execute permission (directory) • Determine if the files are searchable • chmod a-x book • ls book • ls book/book1 • cd book • chmoda+x book Why?

More Related