% Week 04 Notes for CST8207 - Winter 2012 % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Winter 2012 - January to April 2012 Midterm Tests ============= Your first midterm test will be in class Friday February 10 in Week 5. * The Midterm Test dates are posted on the [Course Home Page]. * Tests are short answer and multiple choice. * For full mark credit, read the [Test Instructions] for important directions on how to enter your answers on the mark-sense forms. * Each Midterm covers material on the preceding assignments and Weekly Notes, with emphasis on material in the assignments. * Basic calculators are permitted for this test and the final exam but will not be needed. (No phones or PDA devices.) ### Practice Questions for Midterm Test 1 ### * [Practice Questions for Midterm Test 1](practicetest1.pdf) (46KB PDF) - the answers are also posted in the Class Notes off the [Course Home Page] Lecture Notes for This Week =========================== From the Class Notes link on the Course Home Page ------------------------------------------------- * [Test Instructions](000_test_instructions.html) - Important directions on how to enter your answers on the mark-sense forms. * This is [Your Brain on the Internet](005_this_is_your_brain.txt) * [Frequently Asked Questions](007_freqently_asked_questions.html) * [How to report Problems](008_how_to_report_problems.txt) * [Installing VMware Tools](010_vmware_tools.html) * [Why Learn the Unix Shells?](100_why_shell.txt) * [Command Line vs. GUI: Power Users need more than GUI](110_command_line_vs_gui.txt) * [The Unix/Linux Shell](120_shell_basics.html) * [Searching for items in the Unix manual pages (RTFM)](130_man_page_RTFM.txt) * [Options and Arguments on Unix Command Lines](140_arguments_and_options.txt) * [Unix/Linux Pathnames (absolute, relative, dot, dot dot)](150_pathnames.txt) * [Hard links and Unix file system nodes (inodes)](200_links_and_inodes.html) * [Unix/Linux File System - (correct explanation)](210_file_system.txt) * [Directories: ROOT, /root, HOME, /home, and current](220_home_and_HOME.txt) * [Searching for and finding files by name, size, etc.](250_finding_files.txt) * [GLOB patterns (wildcard pathname matching)](260_glob_patterns.txt) * [Unix Shell I/O Redirection (including Pipes)](270_redirection.txt) * [Unix/Linux Shell Command Line Quoting Mechanisms](280_quotes.txt) * [The VI (VIM) Text Editor](300_vi_text_editor.html) * [Unix/Linux Command List (cumulative)](900_unix_command_list.txt) ### Assignments and Labs ### * See your [Blackboard] ToDo list for all assignment due dates * Finish [Lab #03] - Using Standard Linux Commands II * Start [Lab #04] - Linux Shell Features * Start [Lab #05] - The VI/VIM Text Editor From the Classroom Whiteboard/Chalkboard ---------------------------------------- * Your in-class notes go here. - If you're not actively taking notes in class, why are you here? - Assignments must be [Right the First Time](week01notes.html#right-the-first-time) * Send me video from the Rap. My wife wants to see me. * Guest lecturer Michael Anderson Friday February 3. (I'm in Waterloo.) ### Topics: Operating Systems, Linux, Shells, and File Systems ### * Review: absolute vs. relative pathnames - [Unix/Linux Pathnames (absolute, relative, dot, dot dot)](150_pathnames.txt) - Explain: \ `mkdir foo foo/bar ; rmdir foo ; rmdir foo/bar foo` - draw path hierarchy diagrams when you do an assignment * Review: inodes, directories, and hard links - [Unix/Linux File System - (correct explanation)](210_file_system.txt) - remember: file data and file names are in different inodes, each with its own set of permissions - True/False: you need write permission on a file to change its name - True/False: you need write permission on a file to delete it - True/False: removing a file name with "rm" deletes the file - True/False: you need read permission on a file to create a new name for it * Linux is a multi-user operating system - files and directories may be owned by different users - system files are generally owned by the **`root`** super-user - permissions protect files and directories * Syntax: Writing control characters: CONTROL-D == CTRL-D == ^D - [The Unix/Linux Shell](120_shell_basics.html) * System directories (most anything not under /home belongs to the system) - usually owned by the **`root`** super-user (use `ls -l` to check) - system files have **no** write permission for ordinary users - sometimes have no **read** permission for ordinary users - **`/root`** - the home directory of the **`root`** super-user account - **`/etc`** - configuration files, e.g. **`/etc/passwd`** - password file - **`/dev`** - hardware device files (disks, terminals, etc.) - **`/boot`** - Linux kernel and start-up files - **`/bin`** - program executable files (also **`/usr/bin`**) - **`/sbin`** - privileged and system program executable files (also **`/usr/sbin`**) - **`/lost+found`** - for inodes orphaned after file system damage - **`/proc`** - fake directory full of system and executing process information - try: **`ls -l /proc/self/.`** ### Topic: more Commands ### * Commands: [Unix/Linux Command List (cumulative)](900_unix_command_list.txt) - `ls (-a -i -l -F -R)` - `cp (-r -a)` - `find and locate` - see [Searching for and finding files by name, size, etc.](250_finding_files.txt) - `cal 9 1752` - `grep (-i -v -w)` - `wc (-l -w -c)` - `nl` (same as `"cat -n"`) - `head, tail` - `sort (-f -n -r)` - `uniq (-c)` - `hostname` ### Topics: Shell Features ### * Shell Aliases - you can create your own names for simple commands and options - e.g.: `$ alias ls="ls -abp --color=auto"` [Test Instructions]: 000_test_instructions.html [000_README.txt]: 000_README.txt [000_Licensing.txt]: 000_Licensing.txt [005_this_is_your_brain.txt]: 005_this_is_your_brain.txt [007_freqently_asked_questions.html]: 007_freqently_asked_questions.html -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown](http://johnmacfarlane.net/pandoc/) format