21
CIS 90 - Lesson 6 Lesson Module Status • Slides – basics • Test ready and copies made - • Properties - done • Flash cards – • No-stress quiz – done • Web Calendar summary – done • Web book pages – done • Commands – done • Skills pacing - NA • Lab – done • Supplies – NA • Class PC's – NA

CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Embed Size (px)

Citation preview

Page 1: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Lesson Module Status• Slides – basics• Test ready and copies made - • Properties - done• Flash cards – • No-stress quiz – done • Web Calendar summary – done • Web book pages – done• Commands – done• Skills pacing - NA• Lab – done• Supplies – NA• Class PC's – NA

Page 2: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Objectives Agenda

• Be able to create, copy, move, remove and link files

• Planning survey

• Housekeeping

• Test

• Managing files

• Wrap up

= hands on exercise for topic

Managing Files

Page 3: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 5

Housekeeping

Page 4: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Previous material and assignment

1. Planning survey by "trained assistant"

2. Questions on previous material or labs?

Page 5: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Test

CIS 90 - Lesson 6

/

You may use:• One 8.5" x 11" crib sheet• Local access to the Red Hat VM• Remote access to OpusWhat are the three elements of a UNIX file?

•What are two commands you can use to read through long text files?

•How do you distinguish between relative and absolute paths?

Page 6: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

ManagingFiles

Page 7: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemObjectives

CIS 90 - Lesson 6

/

• Name the three elements of a Unix file, and where each is stored. • Be able to manage the files in your home directory using:

mkdir cp mv rmdir rm ln

Page 8: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 – Lesson 6

UNIX FilesThe three elements of a file

/home/cis90/simmsben/Poems $ lsant Blake nursery Shakespeare twister Yeats

/home/cis90/simmsben/Poems $ ls -l twister-rw-r--r-- 1 simmsben cis90 151 Jul 20 2001 twister

/home/cis90/simmsben/Poems $ cat twisterA tutor who tooted the flute,tried to tutor two tooters to toot.Said the two to the tutor,"is it harder to toot? Or totutor two tooters to toot?"

Page 9: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Partition Boot Sector

Data

Master Boot Record (MBR)

Partition Boot Sector

Data

Partition Boot Sector

Data

Partition Boot Sector

Data

Unused Boot Sector

Data

Unused Boot Sector

File SystemsLinux

Superblock

Inode Table

ext2 file system

Data Blocks

Page 10: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Superblock

Inode Table

ext2 file system

Data Blocks

[simmsben@opus ~]$ls -il letter102609 -rw-r--r-- 1 simmsben cis90 1044 Jul 20 2001 letter

Hello Mother! Hello Father!

Here I am at Camp Granada. Things are very entertaining,and they say we'll have some fun when it stops raining.

All the counselors hate the waiters, and the lake hasalligators. You remember Leonard Skinner? He gotptomaine poisoning last night after dinner.

Now I don't want this to scare you, but my bunk mate hasmalaria. You remember Jeffrey Hardy? Their about toorganize a searching party.

Take me home, oh Mother, Father, take me home! I hate Granada.Don't leave me out in the forest where I might get eatenby a bear! Take me home, I promise that I won't make noise,or mess the house with other boys, oh please don't make mestay -- I've been here one whole day.

Dearest Father, darling Mother, how's my precious littlebrother? I will come home if you miss me. I will evenlet Aunt Bertha hug and kiss me!

Wait a minute! It's stopped hailing! Guys are swimming!Guys are sailing! Playing baseball, gee that's better!Mother, Father, kindly disregard this letter.

Alan Sherman

bigfile 102574bin 102575letter 102609

bigfile 102574bin 102575letter 102609

102609

-

1

simmsben

cis90

1044

2001-07-20

2008-08-08

2008-06-20

Pointer(s) to data blocks

inode number

Type

Number of links

User

Group

Size

Modification time

Access Time

change time

Pointer(s) to data blocks

rw-r—r-- Permissions

Page 11: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemCreating

CIS 90 - Lesson 6

/

Commands:

touch• creates an empty ordinary file(s), or if the file already

exists, it updates the time stamp.

mkdir• creates an empty directory(s)• options: -p

echo "string" > new file• Creates or overwrites a text file

Page 12: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemCopying

CIS 90 - Lesson 6

/

Commands:

cp <source file> <target file> orcp  <source file> <target directory> orcp  <source file> <source file> <target directory>   

options: -i –r

i = warns before overwritingr = recursive (copies all sub folders)

Page 13: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemMoving

CIS 90 - Lesson 6

/

Commands:

mv <source file> <target file> ormv  <source file> <target directory> ormv  <source file> <source file> <target directory>   

options: -i

i = warns before overwriting

Page 14: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemRenaming

CIS 90 - Lesson 6

/

Commands:

mv <original name> <new name>

Page 15: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemRemoving

CIS 90 - Lesson 6

/

Commands:

rm <filename>... options: -i -r –f

i = prompt before overwriter = recursive (delete subdirectories)f = force (never prompt)

rmdir <directory name> Directories must be empty for this to work

Page 16: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

Managing the UNIX/Linux File SystemLinking

CIS 90 - Lesson 6

/

Commands:

ln <existing-name> <new-name> options: -s

s = symbolic link (like Windows shortcut)

Page 17: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Class ExerciseManaging Files

In your home directory, create a directory named oct-08-2008 Change into the new directory Create four files named zero, one, two, three, and four, each

containing the digit according to the name of the file. E.g echo 1 > one

Rename the zero file so that it is a hidden. Print the first line of each file with one command. Create a new directory inside oct-08-2008 named numbers. Copy all the files into the directory numbers. How about .zero? Copy that file too into numbers. Remove the four files from the oct-08-2008 directory. change into the numbers directory and move the files there back up to

the parent directory. Hard link one to uno, two to dos, three to tres, and four to cuatro Make symbolic links 1 to one, 2 to tow, 3 to three and 4 to four. Remove the numbers directory. Explain everything in ls –li output to a partner.

Page 18: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Wrap up

Page 19: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 191 - Lesson 6

New commands:cp copy filesln link filesmkdir make directorymv move or rename filesrm remove filesrmdir remove directorytouch make/modify a file

Page 20: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Next Class

Assignment: Check Calendar Page on web site to see what is due next week:http://simms-teach.com/cis90calendar.php

Quiz questions for next class:

•What command is used to rename a file?

•If two files are hard linked do they have the same or different inode numbers?

•What option for the rm command provides confirmation when deleting files?

Page 21: CIS 90 - Lesson 6 Lesson Module Status Slides – basics Test ready and copies made - Properties - done Flash cards – No-stress quiz – done Web Calendar

CIS 90 - Lesson 6

Backup