1 / 11

CS311 – Lecture 02 Outline

CS311 – Lecture 02 Outline. Common Unix/Linux utilities File/Directory Permissions Unix/Linux Features Note: These lecture notes are not intended to replace your notes. This is what I expect your notes to look like, but with more explanation as needed. 1. How the shell "finds" the command.

braden
Télécharger la présentation

CS311 – Lecture 02 Outline

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. CS311 – Lecture 02 Outline Common Unix/Linux utilities File/Directory Permissions Unix/Linux Features Note: These lecture notes are not intended to replace your notes. This is what I expect your notes to look like, but with more explanation as needed. CS311 – Operating Systems 1 1

  2. How the shell "finds" the command 3 steps: Step 1: check builtins Step 2: did user enter a path? Step 3: use PATH CS311 – Operating Systems 1 2

  3. Utility: ls list directory content -a: do not ignore entries starting with . -l: use a long listing format CS311 – Operating Systems 1 3

  4. More Utilities pwd: print name of current/working directory which: shows the full path of (shell) commands. cat: takes its input from standard input or from files, then displays them to standard output. echo: display a line of text mkdir: make directories cd: change directory chmod: change file access permissions CS311 – Operating Systems 1 4

  5. Side-note: File and Directory Lecture 02 • Directories are files, too • Directories named . and .. • . current directory • .. parent directory CS311 – Operating Systems 1 5 5

  6. Even More Utilities mv: move (rename) files cp: copy files and directories rm: remove files or directories rmdir: remove empty directories wc: print the number of newlines, words, and bytes in files groups: print the groups a user is in newgrp: log in to a new group chgrp: change group ownership CS311 – Operating Systems 1 6

  7. File Permissions • Octal numbers • 741 -> 111 100 001 -> rwx for owner, r for group, x for world • 654 -> 110 101 100 -> rw for owner, rx for group, r for world • chmod 751 myDir • owner can ls, add files, and search the directory for a file • group can ls and search the directory for a file • world can search the directory (but cannot ls to see what else is there) CS311 – Operating Systems 1 7

  8. File Permissions (cont.) • Unix/Linux filesystem security is achieved via 2 mechanisms: • file ownership • file permissions CS311 – Operating Systems 1 8

  9. Filename wildcards * matches 0 or more characters in a filename* can be used alone. E.g.: chmod 700 * ls ?????will list all files that have 5 character filenames. CS311 – Operating Systems 1 9

  10. Output redirection > Sends output to the file listed after the > instead of to stdout (usually the monitor). If the file listed after the > does not exist, it is created. If it does exist, it is overwritten. CS311 – Operating Systems 1 10

  11. Other features up arrow – history tab completion CS311 – Operating Systems 1 11

More Related