Class Notes (835,600)
Canada (509,275)
CSC209H1 (41)
Karen Reid (20)
Lecture

jan09c.docx

2 Pages
56 Views
Unlock Document

Department
Computer Science
Course
CSC209H1
Professor
Karen Reid
Semester
Winter

Description
 Files and Directories $ chmod g+r both o Everything is a file $ ls -l both -rwxr----- 1 craig istr 33 Jan 9 18:43 both  Ex. in Linux can view processes as files by ls /proc $ chmod go+x both o Unix provides a file interface for all Input/Output $ ls -l both  Regular files -rwxr—x--x 1 craig istr 33 Jan 9 18:43 both  Directories $ chmod g-xr both $ ls -l both  Devices -rwx-----x 1 craig istr 33 Jan 9 18:43 both  Video (block)  Keyboard (character) o To see/change groups $ groups  Sound (audio) istr csc108h csc209h cs108hi cs209hi frog  Network (block) o File interface = open, read, write, close $ chgrp csc209hi both $ ls -l both  Applicable to everything, files, processes, devices -rwx---r-x 1 mcraig cs209hi 33 Jan 9 18:43 both o Files in Linux in tree, root = /  absolute path  Changing file access and modification times with touch  Ex. ls /u/csc209h/winter/pub o ls file* lists all files matching the string file*  String after ls is a path, each one is a directory  i.e. file1, file, file3  !$ = last element of the last line  equitable to ls –l | grep test  If / not there, then it releative to the current working directoryhe touched file doesn’t exist, create one with the given name ls file* o Output to file use: some standard out > filename  Ex. my_first_shell_script file1 file2 $ cat my_first_shell_script $ touch file3 #! /bin/sh $ ls -l file* -rw------- 1 mcraig instrs 14 Jan 9 18:43 file1 mkdir eveningClass -rw------- 1 mcraig instrs 19 Jan 9 18:43 file2 echo today is our first lecture -rw------- 1 mcraig instrs 0 Jan 9 19:49 file3 echo michelle still feels like she is in $ ls -l f* portugal -rw------- 1 mcraig instrs 127 Jan 9 17:45 faculty cd eveningClass -rw------- 1 mcraig instrs 14 Jan 9 18:43 file1 -rw------- 1 mcraig instrs 19 Jan 9 18:43 file2 echo this is file1 > file1 -rw------- 1 mcraig instrs 0 Jan 9 19:49 file3 sed 's/1/2/' < file1 > file2 -rw------- 1 mcraig instrs 118 Jan 9 18:46 first_name_first cd .. $ touch filelongname ls eveningClass > filelist $ ls -l file* $ cat filelist -rw------- 1 mcraig instrs 14 Jan 9 18:43 file1 file1 -rw------- 1 mcraig instrs 19 Jan 9 18:43 file2 file2 -rw------- 1 mcraig instrs 0 Jan 9 19:49 file3 $ ls eveningClass/ -rw------- 1 mcraig instrs 0 Jan 9 19:50 filelongname file1 file2 $ ls -l file? -rw-------
More Less

Related notes for CSC209H1

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit