CS155: NFS, Permissions, and pico Lecture 4 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CS155: NFS, Permissions, and pico Lecture 4

Description:

CS155: NFS, Permissions and pico. Permissions, Ownership, and ls -l ... We will cover three: pico, emacs, vim. Pico is the simplest (and least powerful) ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 15
Provided by: csColo
Category:

less

Transcript and Presenter's Notes

Title: CS155: NFS, Permissions, and pico Lecture 4


1
CS155 NFS, Permissions, and picoLecture 4
2
Review
  • Commands wc, grep, cut, sort, uniq
  • Examples
  • cut -f2 -d names sort -n
  • Selects the second space delimited column from
    names and sorts the lines numerically
  • grep ID .txt
  • Searches for lines containing ID in files
    that end with .txt
  • sort ids uniq wc l
  • Sort the ids file, remove duplicate lines, and
    count

3
NFS More File System Facts
4
Permissions, Ownership, and ls -l
gt ls l total 8 -r-xr-xr-x 1 smith under 235
Dec 18 1222 program1 -rw------- 1 boese fac
4 Jan 19 1443 my_file2 drwx------ 2 boese
fac 4096 Jan 19 1444 new_dir
Owner
Group
Permissions
  • Every file and directory in the file system is
    owned by some user and belongs in some group.
  • Generally, a file is owned by whoever created it
    and belongs to that users default group.

5
Permissions in Detail
  • d in the first position means directory
  • - in the first position means file
  • r read
  • w write
  • x execute
  • The permissions can be different for user, group
    and other (everyone else)

6
Permissions What do they mean?
  • r gives permission to view the contents of a
    file or directory
  • w gives you permission to modify a file or
    directory
  • x gives you permission to execute a file or
    cd into a directory
  • Programs must have the execute permission set in
    order to be run.

7
Permissions Examples
  • drwxr-x---
  • owner list, modify (add or rm files), and cd
  • group list and cd
  • other no access
  • -r--r--r-- a file that can only be read
  • -rw-rw-r-- a file that can be read by everyone
    but only written to by the owner and group members

8
chmod Changing Permisions
  • chmod change mode
  • Often we will want to grant or restrict access to
    certain files or directories. chmod allows us to
    do this in two ways.
  • We can add or subtract permissions for user u ,
    group g , and other o
  • We can also set all permissions at once.

9
chmod use
  • chmod MODE,MODE file
  • MODE is formed by combining
  • level u , g , or o (or a combination),
  • modify symbol , - , or
  • permission r , w , x
  • Example chmod ugwx gives user and group write
    and execute permissions

10
chmod examples
  • chmod ugor file give everyone permission only
    to read file. (-r--r--r--)
  • chmod goxw file grant group and other execute
    and write access to file. (-r--rwxrwx)
  • chmod o-rwx file take away read, write, and
    execute access from users not in group or user.
  • (-r--rwx---)
  • chmod urwx file give the user read, write, and
    execute access. (-rwxrwx---)

11
chmod by numbers
  • chmod file
  • is a three digit number specifying the access
    for user, group, and other.
  • Example chmod 754 file will give user rwx, group
    r-x, and other r--.

0 --- 4 r-- 1 --x 5 r-x 2 -w- 6
rw- 3 -wx 7 rwx
12
Text Editors
  • A text editor allows you to modify the contents
    of a file in a convenient way.
  • For Windows users, think notepad not Microsoft
    Word.
  • We will cover three pico, emacs, vim
  • Pico is the simplest (and least powerful). We
    will cover it first.

13
PICO
  • A simple text editor that provides basic editing
    functions
  • Most commands are performed by pressing Ctrl and
    some other key.
  • The symbol in front of a character means press
    Ctrl and that character.

14
pico Some Commands
  • Up Ctrl-P
  • Down Ctrl-N
  • Left Ctrl-B
  • Right Ctrl-F
  • Beginning of Line Ctrl-A
  • End of Line Ctrl-E
  • Page Up Ctrl-Y
  • Page Down Ctrl-V
  • Cut Text Ctrl-K
  • Paste Text Ctrl-U
  • Save Ctrl-O
  • Quit Ctrl-X
Write a Comment
User Comments (0)
About PowerShow.com