------------------------ Week 4 Notes for DAT2330 ------------------------ -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) ------ Review ------ In Week 3 (week03notes.txt) you read more in Chapter 4 and some notes posted to the Notes area of the course home page. (Remember that Chapter 9 contains a quick tutorial on using the VIM editor.) You now know some basic meaning and usage of these Unix/Linux commands: bash passwd pwd cd mkdir rmdir rm ls vim cat more less man echo cp stty du wc date chmod who You can use the "man" command and you can search for keywords in pages. You can use the shell to redirect the output of any command into a file. You know how to write simple executable shell scripts. You received Exercise #3 and submitted it by the due date. ------------------ This Week (Week 4) ------------------ Lecture: * A detailed exploration of Redirection. - see the new file redirection2.txt under Notes * GLOB patterns do not match hidden files unless you explicitly include the leading period: echo .* * You can put multiple commands on one line by separating them with the semi-colon shell metacharacter: date ; who ; ls ; pwd * Quoting is used to hide metacharacters (including blanks) from the shell: echo "hello >out" * Lines end in newline ("\n", NL) characters on Unix. On Microsoft systems, they end in carriage-return ("\r", CR) followed by newline. On Macintosh systems, they end in carriage-return characters. When counting the characters in a file, remember to count the newlines: The line "hi", when stored in a Unix file, occupies 3 characters. The output of "echo hi | wc -c" is "3". New Unix commands used: mesg mv head tail touch sort (with option -n for numeric and -r for reverse sorting) cat (with multiple pathnames) "grep pattern file" e.g. grep alleni /etc/passwd "rm -r dir" "man -k keyword" 1. Review previous weekly readings in Running Linux, Chapter 4. 2. Read these new files under the Notes button on the course home page: redirection2.txt Unix Shell I/O Redirection - Part II practiceTest1.* Practice Test (PDF, PS, and TXT format) practiceCommands_1.txt Practice commands There is only one version of the practice test; the .ps and .pdf files have identical content; the .txt file has the same questions in a different random order. The answer key is at the end of each practice test. The practice commands file is a set of questions and exercises of varying difficulty. You should know how to do most of these questions based on the Lectures and readings. 3. Start work on DAT2330 Exercise #4. Submit it by the due date. 4. Study for the Midterm Test coming next Monday. See the practice files. Midterm Textbook Topics: "Intro", "Logging In", "Setting a Password", "Virtual Consoles" p.81-84 "Directories", "Listing Files" p.84-86 "Viewing Files" p.86-87 "Shells" p.88-89 "Useful Keys" p.90 "Typing Shortcuts", "Word Completion" p.91-92 "Moving Around Among Commands" p.92 "Filename Expansion" p.92 "Saving Your Output" p.93 Midterm Notes files: redirection2.txt Unix Shell I/O Redirection - Part II redirection.txt Unix Shell I/O Redirection pathnames.txt Unix/Linux Pathnames miscellaneous.txt Miscellanous Unix Facts internet_basics.html Internet Networking Basics, URLs, etc. home_and_HOME.txt Directories: current, HOME, and /home arguments_and_options.txt Options and Arguments on Unix Command Lines quotes.txt Unix/Linux Shell Command Line Quoting shells.txt The Unix Shell man_page_RTFM.txt Searching for items in the manual pages (RTFM) I will not be asking questions about how to use the VIM editor on this test (start of Chapter 9).