Updated: 2017-01-20 00:48 EST
vi/vim, nano
head, tail
find
using “wildcard” (GLOB) patterns - same as shell GLOB.bashrc
fileCheck the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. Just like in the Real World, not all due dates are on the same days or at the same times.
PS1 find mkdir mv cp touch file
PS1, find, mkdir, mv, cp
Worksheets are preparation for your assignments. You can’t do the assignments without having done the worksheets first, and you can’t do the worksheets without having first read the Course Notes: 1. Read. 2. Worksheet. 3. Assignment.
Form a small study group to do the worksheets. Each person tries the example given, and you make sure you all get the same answers. Worksheets are not for hand-in; they are not worth marks; the assignments test your knowledge of the lectures and worksheets.
The worksheets are available in four formats: Open Office (ODT), PDF, HTML, and Text. Only the Open Office format allows you “fill in the blanks” in the worksheet. The PDF format looks good but doesn’t allow you to type into the blanks in the worksheet. The HTML format is crude but useful for quick for viewing online.
Do NOT open the Worksheet ODT files using any Microsoft products; they will mangle the format and mis-number the questions. Use the free Libre Office or Open Office programs to open these ODT documents. On campus, you can download Libre Office here.
These first two worksheets require you to have read File System and Pathnames:
PS1, cd, find, less, ls, man, mkdir, passwd, pwd, rmdir
cat, clear, cp, find, grep, history, less, man, mv, rm, sleep, touch
alias, sum, unalias
date, head, nl, tail, tr, wc
vim
vimtutor
program on the CLS.Worksheets prepare you for the upcoming assignments.
Read the Test Instructions (all the words) before your midterm tests. Use the Name Game link to test your name before the test. I don’t answer questions about the instructions during the test.
Tests take place in class in your 50-minute lecture period, not in your lab period. Each midterm test is 45 minutes long and contains approximately 45 multiple-choice questions similar to those found in Practice Tests and Answers.
;
to separate multiple commands on the same line, to save space and paper, e.g. three separate commands can be written on one line like this: date ; echo "hi" ; ls
Three Blackboard quizzes are created from the Practice Tests made available before the two Midterm tests and Final Exam.
Each Midterm and Final Exam will have an associated set of unmarked practice questions and a set of marked quizzes based on those practice questions.
See the course outline for the mark weight of all course quizzes, midterm tests, and exams.
The quizzes are open-book, but the Midterm Tests and Final Exam are closed-book (as will be your job interview).
Each Midterm Test quiz is a small sample taken from the associated full Practice Test located in Practice Tests and Answers.
Each quiz is 10 questions long and you see the answers right after you submit the quiz. You can take the quiz as many times as you like. Every time you take the quiz, you get a random set of ten questions from the practice test.
You will not see all the practice questions by doing quizzes; to see all the practice questions, you must do all the questions in the actual PDF practice test posted in the Course Notes. Review the full PDF file; don’t rely on the quizzes to prepare you for the test!
Each quiz closes just before the Final Exam in this course; quizzes submitted after the Final Exam begins may not count toward your best score.
Your mark for this quiz is the average of your five best quiz scores. Examples:
Your score will be taken from the five best scores. The more times you do the quiz, the more likely you are to have a set of excellent best scores. You must have five perfect quiz scores to get a perfect averaged quiz mark. Missing quizzes (fewer than five) count as zeroes. Only the five best scores are averaged. (Blackboard averages all the scores and thus displays your score incorrectly. Ignore the mark on Blackboard.)
This quiz closes just before the Final Exam in this course; quizzes submitted after the Final Exam begins may not count toward your best score.
See the Assignments and Quizzes section in the Blackboard left side-bar for your course.
Note: Blackboard displays the quiz mark incorrectly, since it cannot calculate “best 5” and instead averages the marks of all your quiz attempts. Your quiz mark is actually the average of your five best attempts, not all the attempts as shown by Blackboard. Ignore the Blackboard mark; it is wrong.
Take notes in class! Keep a pad open on your desk.
This week, we finish with GLOB patterns and learn about redirection and pipes.
Students will have their CLS accounts disabled if they have not changed their default password. (I do not want people breaking into my machine because of you.)
See my online timetable for how to make an office appointment to see me if you want your account back.
Your time as a student is valuable. See the notes from last week.
Keep a notebook with a List of Commands in it. - You need to write down yourself what each command does. - I will check for this list in your lab periods. - Check the updated list of commands each week.
The stupid nano
text editor. (Learn vim
instead!)
-name
arguments to find
find
GLOB patterns to hide them from the shell!cp cal.txt >calnew,txt # WRONG: error message from cp
mv cal.txt ../../ >cal.txt # WRONG: what is now in cal.txt ?
cp
or mv
together. These commands do not produce anything on standard output that is worth redirecting. Usually, the commands produce no output at all. Do not use redirection with mv
or cp
.cp file.txt ../../../ file.copy # WRONG
cp file.txt ../../../file.copy # RIGHT
Stop using cd
Windows People! Use pathnames! This is very inefficient:
$ cd CST8207-16F
$ cd Assignments
$ cd assignment03
$ cd topdir
$ cd other
$ cat foo.txt
This is all you need to do (using the TAB key to help you):
$ cat CST8207-16F/Assignments/assignment03/topdir/other/foo.txt
Stop using cd
Windows People! Use pathnames! This is very inefficient:
$ cd dir1
$ cd subdir
$ touch file
$ cd ..
$ cd ..
$ cd dir2
$ cd subdir
$ touch file
$ cd ..
$ cd ..
[...etc...]
This is all you need to do (using the TAB key to help you):
$ touch dir1/subdir/file dir2/subdir/file [...etc...]
If a pathname doesn’t work, use ls
to find out why. Usually it’s because you’re spelling it wrong. Use the TAB key and the shell will complete the pathname for you, with no spelling errors.
See last week.