Updated: 2016-05-13 18:22 EDT
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
Worksheets are preparation for your assignments. You can’t do the assignments without having done the worksheets first.
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.
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.PS1, find, mkdir, mv, cp
Read the Test Instructions (all the words) before your midterm tests.
Tests take place in class in your one-hour lecture hour, not in your lab period.
;
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
This Blackboard quiz is one of several quizzes in this course. Each midterm and final exam will have an associated quiz. 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).
This quiz is based on the Midterm #1 Practice Test questions that are posted in the Class Notes. The 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.
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.
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! Your in-class notes would go here.
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-16W
$ 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-16W/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.
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.
head, tail, fgrep, wc
ls /bin/*sh | wc
idallen
(over 500 lines on the CLS):
fgrep 'idallen' /etc/passwd | wc
fgrep -c 'idallen' /etc/passwd
fgrep 'refused connect' /var/log/auth.log | tail
fgrep 'password' /var/log/auth.log | tail
fgrep 'idallen' /etc/passwd | tail
last abcd0001 | head
find -name
expressions: find /etc -name '*pass*'
The CLS will lock out your IP address if you can’t type your own userid or password correctly:
Jan 13 23:04:00 Invalid user xxxxnnn from 173.34.159.182
Jan 13 23:05:37 Failed password for invalid user xxxxnnn from 173.34.159.182
Jan 20 22:41:09 Failed password for xxxxnnnn from 173.34.159.182
Jan 20 22:43:07 Failed password for xxxxnnnn from 173.34.159.182
Jan 25 23:13:28 Failed password for xxxxnnnn from 173.34.159.182
Jan 26 21:44:48 Failed password for xxxxnnnn from 173.34.159.182
Jan 27 15:41:28 Failed password for xxxxnnnn from 173.34.159.182
Jan 27 22:10:11 Failed password for xxxxnnnn from 173.34.159.182
Jan 27 22:10:37 Failed password for xxxxnnnn from 173.34.159.182
Jan 29 23:23:34 Failed password for xxxxnnnn from 173.34.159.182
Feb 1 12:53:13 Failed password for xxxxnnnn from 173.34.159.182
Feb 1 12:53:28 Failed password for xxxxnnnn from 173.34.159.182
Feb 1 13:01:45 Failed password for xxxxnnnn from 173.34.159.182
Feb 1 13:02:14 Invalid user abcd0001 from 173.34.159.182
Feb 1 13:05:28 Invalid user abcd0001 from 173.34.159.182
Feb 1 22:04:06 Failed password for xxxxnnnn from 173.34.159.182
Feb 2 20:10:14 Failed password for xxxxnnnn from 173.34.159.182
Feb 2 20:10:39 Failed password for xxxxnnnn from 173.34.159.182
Feb 2 20:32:01 refused connect from cpe84948cd25e71-cm84948cd25e70.cpe.net.cable.rogers.com (173.34.159.182)
If this happens, you have to follow the posted directions to have me unlock your IP address. You can change to another IP address. You can always come to school where no IP addresses are locked out.