% CST8207 Week 06 Notes – Start-up Files, Search $PATH, Quoting, File Systems % Ian! D. Allen – – [www.idallen.com] % Fall 2014 - September to December 2014 - Updated Tue Oct 14 01:55:37 EDT 2014 Readings, Assignments, Labs, and ToDo ===================================== - Read (at least) these things (All The Words): - [Week 06 Notes HTML] – this file – **Read All The Words** - [Start-Up Files] - [Search PATH] - [Quoting] - [Unix/Linux File System – directories, inodes, etc.] - [Hard links and Unix/Linux file system index nodes (inodes)] - [Hard links and Unix file system nodes (inodes)] - [List of Commands You Should Know] - [Video Tutorials on Lynda.com] - Using your [lynda.com] account, watch [Unix for Mac OS X Users] - **3. Working with Files and Directories** - Naming files 5m 41s - use quotes to surround names with blanks or special characters - **5. Commands and Programs** - The PATH variable 4m 13s - **7. Configuring Your Working Environment 41m 28s** - Profile, login, and resource files 9m 11s - Setting and exporting environment variables 4m 54s - Setting the PATH variable 6m 10s - using double quotes instead of single quotes Midterm Test #1 Analysis ------------------------- It took me an hour or two to prepare your midterm test for marking because `43` students out of `153` did not follow the [Test Instructions]. For example: 9 did not fill in any test version numbers 7 did not fill in correct test version numbers 6 did not fill in bubbles for their own NAME 5 did not write any numbers above the test version bubbles 3 did not fill in bubbles for the test version numbers - Number of students who entered their own name incorrectly on the mark-sense form (usually by shortening it): `22` - Number of students who got question `#45` wrong even though the answer was given in the **Test Instructions** printed at the top of the test: `27` *(Number who copied the same answer as on the practice test: `20`)* - Class scores for 153 (out of 162 registered) students: 97.8 97.8 95.6 95.6 95.6 95.6 93.3 93.3 93.3 91.1 91.1 91.1 91.1 90.5 88.9 88.9 88.9 88.9 86.7 86.7 86.7 84.4 84.4 84.4 84.4 84.4 84.4 84.4 84.1 82.2 82.2 82.2 82.2 82.2 82.2 82.2 82.2 82.2 79.8 77.8 77.8 77.8 77.8 77.8 77.8 77.6 77.3 75.6 75.6 75.6 75.6 75.6 75.6 75.6 75.6 75.4 75.2 73.3 73.3 73.3 73.3 73.3 73.3 71.1 71.1 69 68.9 68.9 68.9 68.9 68.9 68.9 66.8 66.8 66.7 66.7 64.7 64.4 64.4 64.4 64.4 64.4 64.4 62.7 62.7 62.5 62.2 62.2 62.2 62.2 62.2 62.2 60.4 60.4 60 60 60 58.6 58.2 58.2 57.8 57.8 57.8 57.8 56.4 55.6 53.3 53.3 53.3 51.1 51.1 51.1 50.1 49.6 48.9 48 46.7 46.7 46.7 46.7 46.7 46.7 46.7 42.2 42.2 41 40.4 40.4 40 40 40 40 39.7 38.8 37.8 37.8 37.6 37.6 36.6 36.4 35.6 35.6 34.4 34.4 33.3 32.4 31.1 27.2 25.9 24.3 22.2 20 13.3 90% - 100% 14 ************** 80% - 90% 25 ************************* 70% - 80% 26 ************************** 60% - 70% 32 ******************************** 50% - 60% 17 ***************** 40% - 50% 19 ******************* 30% - 40% 14 ************** 20% - 30% 5 ***** 10% - 20% 1 * 0% - 10% 9 ********* (9 students did not write the test) - You can see the errors in [Midterm Test #1 PDF]. Assignments and Lab work this week ---------------------------------- Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. - Read All The Words, Do, and then Submit via Blackboard: - [Assignment #04 HTML] – Start-Up, GLOB, redirection, environment - [Assignment #05 HTML] – BONUS Assignment! Extra Marks! Midterm 1 review. - Coming soon: Assignment #06 HTML – quoting, search PATH, linking, disk usage - Really do **Read All The Words**. You don’t get a second chance to get it right. ### 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 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]. - [Worksheet #02 ODT] online viewing: [Worksheet #02 HTML] – Using standard Linux commands I - `PS1, cd, find, less, ls, man, mkdir, passwd, pwd, rmdir` - [Worksheet #03 ODT] online viewing: [Worksheet #03 HTML] – Using standard Linux commands II - `cat, clear, cp, find, grep, history, less, man, mv, rm, sleep, touch` - [Worksheet #04 ODT] online viewing: [Worksheet #04 HTML] – GLOB Patterns and Aliases - bash GLOB patterns (wildcards), `alias, sum` - [Worksheet #05 ODT] online viewing: [Worksheet #05 HTML] – I/O Redirection and Pipes - bash I/O redirection (including pipes), `date, head, nl, tail, tr, wc` ### Optional Bonus Assignments – extra marks - [Assignment #03 HTML] – *Optional* BONUS VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional Reading: [The VI (VIM) Text Editor] - [Worksheet #06 HTML] – *Optional* VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional command-line VIM tutorial: the `vimtutor` program on the CLS. - [Assignment #05 HTML] – *Optional* BONUS Midterm Assignment - This is an *optional* BONUS assignment reviewing your midterm test. - There is a checking script available to verify the format of your file but only people who Read All The Words will find out about it. From the Class Notes link on the Course Home Page ================================================= - Review last week. Did you do everything assigned last week? From the Classroom Whiteboard/Chalkboard ======================================== - **Take notes in class!** Your in-class notes would go here. - Next week (Week 7) has a holiday Monday; the College is closed; no classes. Some students will miss their Monday lab, but can attend any other lab. (You can always attend any other lab.) In Week 7, section 010 Theory class 4pm Friday is cancelled (to match the section 020 Theory class missed on Monday); section 010 students come only to the Wednesday theory class. - Students who don’t do the worksheets or don’t have their own list of commands and what they do are wasting huge amounts of time struggling with the assignments, trying to complete them using Google. Most everything you need to know is in the worksheets and class notes. - Echoing command lines into files (instead of using a text editor) can be tricky. Suppose we want to save this command line: `date | wc >out` into a file named `cmd.txt` by using `echo` to echo it on the screen, and then redirecting the output into a file once what we see on the screen is correct. You can’t just put the word `echo` in front of the first command in a shell pipeline; it won’t echo the command line to the screen correctly. You have to quote all the shell metacharacters first: - `echo date | wc >out`     # doesn’t work; no output on screen - `echo 'date | wc >out'`     # hiding metacharacters does work – command appears on screen - `echo 'date | wc >out' >cmd.txt`     # correct: saves `echo` output in a file Learning the Material --------------------- - You learn the material because you want to be a Computer Systems Technician. - You like doing this work; you want to be good at it. - Review your mistakes on the first midterm test (questions re-appear). - For practice tests and quizzes, see the [Practice Test README] - Review the commands used in each lab worksheet (and their common options). - [Unix/Linux Command List][List of Commands You Should Know] - Review how the shell works: GLOB, redirection, quotes - Know **why** the shell behaves that way. Copy/paste teaches you nothing. - split on semicolons and pipes first, then do redirection - What are the Four Rules for Output Redirection? Three Rules for Pipes? - [Unix Shell I/O Redirection (including Pipes)] Real Sysadmin Work ================== Call for help from the Internet ------------------------------- A sysadmin runs `mkfs` and overwrites the only copy of his company’s disk: From: xxxxxxx xxxxxxx Subject: need help To: idallen@idallen.ca Date: Wed, 1 Oct 2014 00:07:39 +0530 Sir hope you are doing wel... its really bad to ask you about mkfs command recovery after accidental use of it. sir i have lost very imp data on my disk's sd0b partition.hard disk is in shimadzu ct scan system.loaded os LynxOS and it is ok on sd0a partition same drive.after reboot of system a got shocked when system is haltinfg on missing files error. after that i have kept every thing intact no over write.do you have any way out? i am in trouble because of shimadzu doesn't have software disk for old system ,thgey have searched all glob but couldn't find. any way out please help. regards *xxxxxxx xxxxxxx* Tech.Support Microlab Computer Roha-Raigad.Maharashtra **Linux assumes you are competent and does exactly what you ask it to do. Think before you type and keep good backups.** Open Source ----------- - [*Algonquin College CET Student and Open Source*] - *Currently, I am halfway finished with my three year Computer Engineering Technology/Computer Science course at Algonquin College in Ottawa Ontario Canada. It is a great school, and all IT students learn about Linux as part of the course curriculum. Some instructors promote Linux and open source software in their classrooms, while others demand their students run Windows and use proprietary software.* - *At this point in my open source journey, I have so many ideas for open source projects, and once I complete my training I want to contribute to other ongoing projects like Gnome and Cinnamon GUIs, Adobe Brackets, and Fedora. I feel like a kid in a candy store that is waiting for his allowance so I can spend it all!* - *I am treating my education as if it is open source Jedi training. I can’t wait for my first epic battle to begin. May open source be with you…* - [*Linux job market heats up*] - *77 percent of hiring managers have “hiring Linux talent” on their list of priorities for 2014* - *salary increases over the past year that exceeded the average for technology professionals by more than 2 percentage points* - *they got to work on “interesting projects.”* - *The future is a bright one for professionals who know Linux.* - [*The Linux job market is smokin’ hot!*] - The Linux Foundation and Dice report that Linux professionals are in very high demand in the technology job market. - To retain top talent, 38 percent of hiring managers said they accommodate flexible work schedules or telecommuting and 32 percent pointed to salary increases above the company norm. - [*SSH is the most widely attacked port on the Internet*] - You know this by looking at the `auth.log` file on the CLS. - Being a Computer Systems Technician means you need to know your stuff, or else the crackers will break into your machines. - [*Android is Linux*] ![Take Notes in Class] -- | 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] format [www.idallen.com]: http://www.idallen.com/ [Start-Up Files]: 350_startup_files.html [Search PATH]: 400_search_path.html [Quoting]: 440_quotes.html [Unix/Linux File System – directories, inodes, etc.]: 450_file_system.html [Hard links and Unix/Linux file system index nodes (inodes)]: 455_links_and_inodes.html [Hard links and Unix file system nodes (inodes)]: 455_links_and_inodesA.html [List of Commands You Should Know]: 900_unix_command_list.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [lynda.com]: http://algonquincollege.com/onlineresources/mobileStudent/lynda.htm [Unix for Mac OS X Users]: http://www.lynda.com/Mac-OS-X-10-6-tutorials/Unix-for-Mac-OS-X-Users/78546-2.html [Test Instructions]: 000_test_instructions.html [Midterm Test #1 PDF]: midterm1.pdf [download Libre Office here]: 050_course_introduction.html#install-libreoffice-or-openoffice-into-windows [The VI (VIM) Text Editor]: 300_vi_text_editor.html [Practice Test README]: PRACTICE_TEST_README.html [Unix Shell I/O Redirection (including Pipes)]: 200_redirection.html [*Algonquin College CET Student and Open Source*]: http://opensource.com/life/14/2/may-open-source-be-you [*Linux job market heats up*]: http://www.zdnet.com/linux-job-market-heats-up-7000026504/ [*The Linux job market is smokin’ hot!*]: http://www.itworld.com/open-source/406021/linux-professionals-are-high-demand-in-technology-job-market [*SSH is the most widely attacked port on the Internet*]: https://isc.sans.edu/portreport.html?sort=targets [*Android is Linux*]: http://www.zdnet.com/debunking-four-myths-about-android-google-and-open-source-7000026473/ [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Plain Text]: week06notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/