1,234
edits
Changes
no edit summary
{{Admon/caution|DO NOT USE THIS VERSION OF THE LAB. This page will no longer be updated.|'''New version here:''' https://seneca-ictoer.github.io/ULI101/A-Tutorials/tutorial5<br />'''Andrew's students please go here:''' http://wiki.littlesvr.ca/wiki/OPS145_Lab_5}}=USING REDIRECTIONSREDIRECTION: STANDARD INPUT / STANDARD OUTPUT / STANDARD ERROR=
<br>
===Main Objectives of this Practice Tutorial===
:* Understand the purpose of and use the '''Matrix servercut''' and the <u>, '''advantagetr'''</u> of combining Linux servers to form a , and '''clusterwc'''.Linux commands
:* List Define the steps to connect to your Matrix server account from a workstation <u>within</u> a computer lab at Seneca Collegeterms '''.Standard Input''' (''stdin''), '''Standard Output''' (''stdout''), and '''Standard Error''' (''stderr'')
:* List Understand and use the steps to connect to your Matrix server account from your '''laptop>''' or , '''home computer>>'''., '''2>''', '''2>>''' symbols with Linux commands
:* Learn to Effectively Use Understand the purpose of the the '''Command Prompt/dev/null''' (Linux file and the '''shellHere Document''')
:* Perform Define the term '''first two sections on the online assignment #1''' to issue '''general Linux commandspipeline command'''.and explain how a pipeline command functions
:* Define the term '''Exitfilter''' your Matrix Linux Accountand how it relates to pipeline commands
:* Perform Use the '''Review Questionssemicolon''' for ";" and '''additional grouping''' "( )" symbols to issue multiple Unix / Linux Command Practicecommands on a single line :* Use the '''<br>backslash''' "\" symbol to spread-out long Unix/Linux commands over multiple lines<br>
===Tutorial Reference Material===
|- valign="top"
|colspan="2" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;"|Course Notes / Software<br>
|colspan="2" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;padding-left:15px;"|Linux Command/Shortcut Reference<br>
|colspan="1" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;padding-left:15px;"|YouTube Videos<br>
|- valign="top" style="padding-left:15px;"
|colspan="2" |Course Notes'''Slides:'''<ul><li>Week 5 Lecture 1 Notes:<br>[https://ictwiki.cdot.senecacollege.ca/~uli101/notesslides/Week01ULI101-5.1.pdf PDF] | [https://ictwiki.cdot.senecacollege.ca/~uli101/notesslides/Week01ULI101-5.1.pptx PPTX]</li></ulli>TutorialsWeek 5 Lecture 2 Notes:<ul><libr>[https://wiki.cdot.senecacollege.ca/uli101/slides/ULI101-5.2.pdf PDF] | [HOWTOhttps: Access Your Matrix Account]//wiki.cdot.senecacollege.ca/uli101/slides/ULI101-5.2.pptx PPTX]<br></li><li/ul> | style="padding-left:15px;" |'''Redirection:'''* [http://www.linfo.org/standard_input.html Standard Input (stdin)]* [http://czegelwww.linfo.comorg/senecastandard_output.html Standard Output (stdout)]* [http:/uli101/lectureswww.linfo.org/Lecture1standard_error.html Les Czegel's Week 1 Notes Standard Error (HTMLstderr)]* [http://www.linfo.org/pipe.html Pipeline Commands]</libr><br>'''Multiple Commands:'''* [https://www.javatpoint.com/ullinux-semicolon Semicolon]<br>Windows SSH client Software* [https://www.gnu.org/software/bash/manual/html_node/Command-Grouping.html Grouping ( )]<ulbr><libr>| style="padding-left:15px;"|'''Redirection Filters:'''* [http://man7.org/linux/man-pages/man1/more.1.html more] , [http://man7.org/linux/man-pages/man1/less.1.html less]<br>* [http://wwwman7.org/linux/man-pages/man1/head.sfsu1.eduhtml head] , [http:/ftp/winman7.org/sshlinux/SSHSecureShellClientman-3pages/man1/tail.21.9html tail]* [http://man7.exe SSHorg/linux/man-pages/SFTPman1/sort.1.html sort]<br>* [http:/li>/man7.org/linux/man-pages/man1/uniq.1.html uniq]<libr>* [http://thelinuxcommand.earthorg/lc3_man_pages/grep1.lihtml grep]<br>* [http:/%7Esgtatham/puttyman7.org/latestlinux/x86man-pages/puttyman1/cut.1.exe Puttyhtml cut]<br>* [http://linuxcommand.org/lc3_man_pages/litr1.html tr]<br>* [http://man7.org/linux/man-pages/man1/wc.1.html wc]<libr>* [httpshttp://wwwman7.bitvise.comorg/linux/sshman-clientpages/man1/tee.1.html tee]<br> |colspan="1" style="padding-download Bitvise SSH Client]left:15px;" width="30%"|'''Brauer Instructional Videos:'''</liul><li>[https://mobaxtermwww.mobatekyoutube.netcom/downloadwatch?v=ocU34PcYn2U&list=PLU1b1f-home2Oe90TuYfifnWulINjMv_Wr16N&index=4 Reading/Writing to Files<br>(echo, stdin, stdout, stderr, >, >>, 2>, cat, more, less, man, date, diff, diff -edition.html MovaXtermy, find, wc])<br></li></ul>|} = KEY CONCEPTS = ===Additional File Manipulation Commands=== Before proceeding, let's look at some additional commands used to manipulate content of text files. Refer to the table below regarding these text file manipulation commands:<br><br>[[Image:manipulation-commands.png|left|700px|]]<br><br><br><br><br><br><br><br><br>
===Redirection (Standard Input, Standard Output, Standard Error)===
Reference: https://www.javatpoint.com/linux-input-output-redirection
[[Image:stdin-symbol.png|thumb|right|250px|The '''standard input''' ('''stdin''') symbol that describes where a Unix/Linux command receives '''input''']]
'''Standard input''' ('''stdin''') is a term which describes from where a command receives '''input'''.<br>
This would apply only to Unix/Linux commands that accept stdin input<br>(like ''cat'', ''more'', ''less'', ''sort'', ''grep'', ''head'', ''tail'', ''tr'', ''cut'', ''wc'', etc.).<br>
<table align===Purpose "right"><tr><td>[[Image:stdout-symbol-1.png|thumb|right|250px|The '''standard out''' ('''stdout''') symbol with one greater than sign '''overwrites''' existing file content with command output]]</td><td>[[Image:stdout-symbol-2.png|thumb|right|250px|The '''standard output''' ('''stdout''') symbol with two greater than signs '''add''' command's output to '''bottom''' of Having existing file's contents.]]</td></tr></table>'''Standard output''' ('''stdout''') describes where a command sends its '''output'''.<br>In the examples below, output from a Matrix Account===command is sent to the '''monitor''', unless it is sent to a '''text file'''.
<span style="font-family:courier;font-weight:bold">PWD<br>PWD 2> error-message.txt<br>PWD 2 >> error-messages.txt<br>PWD 2> /dev/null</span>
<br><br>
<span style="font-family:* Issuing '''Linux commands''':* Becoming productive using the Linux '''command prompt''' ('''shell'''):* Performing '''Linux Practice Tutorials''':* Performing '''Linux Assignments''' ('''3''')courier;font-weight:* Practice Issuing '''Linux Command Review Questions'''bold;">LS 2> /dev/null<br>ls > /dev/null<br>find / -name "tempfile" 2> /dev/null</span> <br><br>
[[Image:Here Document.png|thumb|right|175px|The '''Here Document''' allows a user to redirect stdin from <u>within<br/u>the command itself.]]In this sectionLinux, you will learn how the '''Here Document''' allows a user to access your Matrix Linux account by two different methods:redirect stdin from within the command itself.
<span style===Part 1"font-family: Access your Matrix Account from a Seneca College Lab ===[[Imagecourier;font-weight:apps-anywhere-main-window.png|thumb|right|250px|'''MyApps''' ('''AppsAnywhere''') Main Window ]]You will learn how to connect to your Matrix Linux account from a workstation in your computer labs at Seneca college.bold">cat <<+<br>Line 1<br>Line 2<br>Line 3<br>+<br><br>
[[Image:pipe-diagram-1.png|thumb|right|450px|A '''MyAppspipeline command''' (sends a command's '''standard output''' directly to '''AppsAnywherestandard input'''of other command(s) is an application streaming service that lets you install software on any Seneca PC on demandwithout having to create temporary files. Any software application on the MyApps menu can be used on computers in classrooms, labs, and the Computing Commons]]'''Pipeline Command:''' Having commands send their '''standard output''' <u>directly</u> to '''standard input''' of other commands WITHOUT having to use '''temporary''' files.
A few simple commands can be '''combined''' to form a more <u>powerful</u> command line.<br>
Commands to the '''right''' of the pipe symbol are referred to as '''filters'''. They are referred to as ''filters'' since those commands are used to '''modify''' the stdout of the <u>previous command</u>. Many commands can be "piped" together, but these commands (filters) must be chained in a specific order, depending on what you wish to accomplish
Commands may also be '''Linux Command Structurespread-out over multiple lines''', making it easier (for humans) to interpret a long command.<br><br>The '''\''' symbol “''quotes-out''” the meaning of the '''ENTER''' key as <u>text</u><br> (i.e. ''new-line'' as instead of ''running'' the command).
=INVESTIGATION 1: BASICS OF REDIRECTION=
<span style="color:red;">'''Getting Help with Linux CommandsATTENTION''': This online tutorial will be required to be completed by '''Friday in week 6 by midnight''' to obtain a grade of '''2%''' towards this course</span><br><br>
'''Perform the Following Steps:'''
# Make certain that '''Login''' to your matrix account and issue a command to '''confirm''' you are logged into located in your Matrix account'''home''' directory.<br><br># Issue the following Linux commandto create the following directory: <span style="color:blue;font-weight:bold;font-family:courier;">man manmkdir ~/redirect</span><br>How many volume numbers are contained <br># Change to the '''~/redirect''' directory and confirm that you changed to that directory.<br><br># Use a text editor to create a file in the man pages (like your current directory called '''data.txt'''executable commandsand enter the following text displayed below:<br><br><span style="font-family:courier;font-weight:bold">This is line 1<br>This is line 2<br>This is line 3</programsspan><br><br># '''Save', ''editing changes and 'games''exit', or ''the text editor.<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">tr 'system administrator commandsa-z''A-Z')< data.txt</span><br><br>What does this command do?<br><br># Press Issue the letter following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">qtr 'a-z' 'A-Z' < data.txt > output.txt</span> to exit <br><br>What does this command do? What are the contents of the file ''output.txt''?<br><br># Issue the man following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">tr 'a-z' 'A-Z' > output.txt < data.txt</span><br><br>What does this command do? Is there any difference in terms of this command and the previous command issued?<br><br># Issue the following Linux command : <span style="color:blue;font-weight:bold;font-family:courier;">tr 'a-z' 'A-Z' >> output.txt < data.txt</span><br><br>What happens to get help with the command: content of the '''lsoutput.txt'''file? Why?<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">tail -2 < data.txt > output.txt</span><br><br>What does this command do? Check the contents of the '''NOTE:output.txt''' You can use file to confirm.<br><br># Issue the following shortLinux command: <span style="color:blue;font-weight:bold;font-family:courier;">tail -cut keys within 2 > output2.txt < data.txt </span><br><br>Why does this command render the same results as the previous command?<br>Try explaining how the man command to works in terms of '''stdin''' and then '''stdout'''.<br><br>help navigate throughout this utility to get help with # Issue the ls following Linux command (refer to table create a file: <span style="color:blue;font-weight:bold;font-family:courier;">cat > output3.txt </span><br><br># Enter the follow text displayed below):<br><br><table cellpaddingspan style="3font-family:courier;font-weight:bold;">This is the file output3.txt</span><br><trbr># Press <th span style="bordercolor:blue;font-weight:bold;font-bottomfamily: 1px solid blackcourier;">Keyboard Shortcutctrl-d</thspan> to exit the command.<br><th br># Issue the '''cat''' command to view the contents of the file: '''output3.txt'''<br><br># Issue the following Linux command: <span style="bordercolor:blue;font-weight:bold;font-bottomfamily: 1px solid blackcourier;">Purpose<cp ~jason.carman/uli101/th>cars .</trspan><trbr><tdbr># Issue the '''cat''' command to view the contents of the '''ENTERcars'''file.<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cut -c1-10 cars</tdspan><tdbr>Move down one line<br>What did this command do?<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cut -f5 cars > field5.txt</tdspan></trbr><trbr>What did this command do?<tdbr>Check the contents in the file '''SPACEBARfield5.txt'''to see what happened.<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cut -f1-3 cars > field123.txt</tdspan><br><br>What did this command do? (check file contents)<tdbr>Move one screen down<br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cut -f1,5 cars > field15.txt</tdspan><br><br>What did this command do? (check file contents)<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">wc cars >count.txt</trspan><trbr><tdbr>What information does the '''count.txt'''<file contain?<br><br># Issue the following Linux command: <span style="color:blue;ctrl>font-weight:bold;<f>font-family:courier;">wc -l cars > count1.txt</span><br><br>What information does the '''count1.txt'''file contain?</tdbr><tdbr>Move one screen up# Issue the following Linux command: </tdspan style="color:blue;font-weight:bold;font-family:courier;">wc -w cars >count2.txt</trspan><trbr><tdbr>What information does the '''/pattern/count2.txt'''file contain?</tdbr><tdbr>Search for Pattern# Issue the following Linux command: </tdspan style="color:blue;font-weight:bold;font-family:courier;">ls -l >listing.txt</trspan><trbr><tdbr>What information does the '''qlisting.txt'''file contain?</tdbr><tdbr>quit man utility# Issue the following Linux command: </tdspan style="color:blue;font-weight:bold;font-family:courier;">pwd >listing.txt</trspan></tablebr><br># Navigate through What happenned to the man utility for original contents of the file called '''lslisting.txt''' ? Why?<br><br># Issue the following Linux command and note (use 2 greater-than signs): <span style="color:blue;font-weight:bold;font-family:courier;">date >> listing.txt</span><br><br>What information does the option letters that correspond to '''listing.txt''' file contain? Why?<br><br># Issue the followingLinux command:<span style="color:blue;font-weight:bold;font-family:courier;">cat listing.txt cars > combined.txt</span><br><ulbr>What information does the '''combined.txt''' file contain? Why?<libr>Include directory entries whose names begin with <br>'''NOTE''': The '''cat''' command stands for "'''concatenate'''" which means to '''combine''' contents of multiple files into a dotsingle file.</libr>This is why the command is called "''cat''".<libr>List in long format</libr># Issue the following Linux command: <lispan style="color:blue;font-weight:bold;font-family:courier;">cat listing.txt cars murray 2>Recursively list subdirectories encounteredresult.txt</lispan><br><libr>Sort files by sizeWhat is displayed on the monitor? What information does the '''result.txt''' file contain? Why?</libr><libr>Display a slash (`# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cat listing.txt cars murray > myoutput.txt 2> /dev/') immediately after each pathname that is a directorynull</lispan></ulbr><br># Exit What is displayed on the man utility for monitor? What happened to the ls command.error message?<br><br># Issue the ls following Linux command for each of : <span style="color:blue;font-weight:bold;font-family:courier;">cat listing.txt cars murray > myoutput.txt 2> result.txt</span><br><br>What is displayed on the monitor? what do those option letters you wrote down to see how this command differs for each option.files contain? Why?<br><br>NOTE: The '''manHere Document''' utility can be used allows you to redirect stdin from with the Linux command itself. Let'''-k''' option to help list Linux commands that match a text pattern that is contained within s get some practice using the Here Document.<br><br># Issue the help screen for a following Linux command.:<br><span style="color:blue;font-weight:bold;font-family:courier;">cat <<+<br>line 1<br>line 2<br>line 3<br>+</span><br><br>What do you notice?<br><br># Although we will not be learning about pipeline commands (using the | character) until later, try issuing Issue the following pipeline Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">man -k copy | grep 82 <<+<br>line 1<br>line 2<br>line 3<br>+</span><br><br>What do you notice? How does this this pipeline command make it easier to obtain information regarding man differ from the previous command? Why?<br><br># If you wish to change your password, you can change it by issuing Issue the following Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">passwdgrep 2 > line2.txt <<+<br>line 1<br>line 2<br>line 3<br>+</span><br><br>What do you notice? What option for is contained in the passwd command can be used to change user info (such as name)file '''line2.txt'''? Why?<br><br>'''HintNOTE:''' use You will now run a shell script to confirm that you properly issued Linux commands using redirection.<br><br># Issue the manpages for following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">~uli101/week5-check-1</span><br><br># If you encounter errors, make corrections and '''re-run''' the passwd commandchecking script until you receive a congratulations message, then you can proceed.<br><br># Issue the '''NOTE:ls''' You are NOT required command to change your Matrix password for this tutorialsee all of the '''temporary files''' that were created as a result of redirection. <br><br>The Matrix server problem with using these redirection symbols is that you create '''temporary text files''' that take up '''space''' on your file system.<br><br># Issue a Linux command (using '''Filename Expansion''') to '''remove''' those temporary text files in the current directory.<br><br># Issue the following Linux command to check that you removed ALL of those temporary text files:<br><span style="synchedcolor:blue;font-weight:bold;font-family:courier;" with >~uli101/week5-check-2</span><br><br># If you encounter errors, make corrections and '''re-run''' the mychecking script until you receive a congratulations message, then you can proceed.senecacollege.ca server<br><br> :In the next investigation, so it is better you will be learning how to have your Matrix password changed at the same time that you change your myseneca passwordissue '''pipeline Linux commands''' which can<br>accomplish tasks <u>without</u> creating temporary files.<br><br> =INVESTIGATION 2: REDIRECTION USING PIPELINE COMMANDS = In this investigation, you will learn to issue '''pipeline commands''' to to accomplish tasks <u>without</u> having to generate temporary files.
'''Perform the Following Steps:'''
# Type Confirm that you are still located in the '''~/redirect''' directory.<br><br>The '''problem''' with creating temporary files, is that they take up space on your server,<br>and should be removed. You actually did that in the previous investigation.<br><br>You will be issuing a '''pipeline command''' which will use the pipe symbol "|"<br>that will send the stdout from a command as stdin into another command<br><u>without</u> having to create temporary files.<br><br># Issue the following follow Linux '''pipeline command, but DON’T press the ENTER key''': <span style="color:blue;font-weight:bold;font-family:courier;">cd ls /bin| more</span><br><br>What happened? Press '''q''' to exit display.<br><br># Press Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-als /bin | who</span> key combination. <br><br>What happenshappened?Although this pipeline command provides output,<br>it '''does <u>not</u> work''' properly as a pipeline command since the '''who''' command is<br>'''NOT''' designed to accept standard input.[[Image:pipe-diagram-1.png|thumb|right|350px|]]<br><br>'''NOTE:''' When issuing pipeline commands, commands to the right of the pipe symbol must be designed to <u>accept</u> '''standard input'''. Since the ''who'' command does not, you did NOT see the contents of the '''/bin''' directory but only information relating to the ''who'' command. Therefore, the '''order''' of which you build your pipeline command and the '''type of command''' that is used as a ''filter'' is extremely important!<br><br># Press Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">alt-Fls /bin/?? > listing.txt</span> key combination (ESC+F for Mac OSx). What happens?<br><br># Press Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-wsort listing.txt</span> shortcut. What happens?<br><br># Type Issue the following Linux commandto remove the listing file: <span style="color:blue;font-weight:bold;font-family:courier;">lsrm listing.txt</span><br><br># Press Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-els /bin/?? | sort </span> key combination and press <br><br>You should notice that the output from this pipeline command is the same output<br>from the command you issued in '''step #5'''.<br><br># Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">ENTERls /bin/?? | sort | more</span><br><br>What is difference with this pipeline command as opposed to the <u>previous</u> pipeline command? Press '''q''' to exit display.<br><br># Press Issue the up arrow key'''ls''' command.<br><br>You should notice that '''no files have been created'''.<br>Let's get practice issuing more pipeline commands using commands<br>(previously learned or new) to be used as '''filters'''. What happens?<br><br># Press Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">ctrlls /bin/?? | sort | head -u5</span> key combination. <br><br>What happensdid you notice?<br><br># Press Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">up arrowls /bin/???? | sort | grep r | tail -2</span> key combination, and see what happens when <br><br>What did you notice? Could you press predict the output prior to issuing this pipeline command?<br><br># Issue the following Linux '''pipeline command''': <span style="color:blue;font-weight:bold;font-family:courier;">BACKSPACEls /bin/???? | sort | grep r | cut -c1-6</span> , <span style="color:blue;fontbr><br>Try to explain step-by-weight:bold"step each process in the pipeline command (including ''filters'')<br>to explain the final output from this pipeine command.<br><ctrl><BACKSPACE><br># Confirm that you are still located in the '''~/spanredirect''' directory.<br><br># Issue the following Linux '''pipeline command''':<br> and <span style="color:blue;font-weight:bold;font-family:courier;"><ctrl><h>ls /bin/???? | tee unsort.txt | sort | tee sort.txt | grep r | tee match.txt | head </span>. Why is it important <br><br># Issue the '''ls''' command to know those series view the contents of key combinationsthis redirectory.<br><br>What did you notice?<br><br># Press View the <span style="color:blue;font-weight:bold"u>ctrl-contents</u> of the '''text files''' that were created to see how the '''tee''' command<br>was used in the previous pipeline command.</spanbr><br>What was the purpose of using the '''tee''' command for this pipeline command?<br><br> key combination You will now run a shell script to clear confirm that you properly issued that Linux pipeline command<br>using the line'''tee''' command and redirection.<br><br># Press Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">ctrl~uli101/week5-check-l3</span> key combination. What happens? What is <br><br>If you encounter errors, make corrections and '''re-run''' the advantage of using this key combination checking script until you receive<br>a congratulations message, then issuing you can proceed.<br><br># Change to <u>your</u> '''home''' directory.<br><br># Remove the '''clear~/redirect''' command?directory and its contents.<br><br>
In this sectioninvestigation, you will learn to '''select the correct section''' for your online assignments, how to perform the '''first two sections''' of assignment #1, how to '''verify''' that you successfully completed both sections, and how to '''exit''' your online assignment #1issue multiple Unix / Linux commands in a single line or over multiple lines.
= LINUX PRACTICE QUESTIONS =
simulate a quiz:
https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101files/uli101_week1_practiceuli101_week5_practice.docx
Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).
When answering Linux command questions, refer to the following Inverted Tree Diagram. The linux directory is contained in your home directory. Assume that you just logged into your Matrix account. Directories are <u>underlined</u>.
[[Image:week5-dir.png|thumb|left|300px|]]
<br><br><br><br><br><br><br><br><br>
'''Review Questions:'''
# What is Write a single Linux command to provide a detailed listing of all files in the '''/etc''' directory, sending the output to a file called listing.txt in the “'''Linux Clusterprojects'''”? What is an advantage of using directory (append output to existing file and use a Linux cluster?relative pathname)# List Write a single Linux command to redirect the stderr from the command:<br>'''three unique server namescat a.txt b.txt c.txt''' at Seneca college and briefly explain to a file called '''error.txt''' contained in the purpose of that server“'''assignments'''” directory. (overwrite previous file’s contents and use only relative pathnames) # List the steps to connect and login to your Matrix Write a single Linux server account from a command: '''workstationcat ~/a.txt ~/b.txt ~/c.txt''' in and redirect stdout to a computer lab at Seneca Collegefile called “good.# List txt” to the steps to connect “tests” directory and login stderr to your Matrix Seneca College account on your a file called “'''laptopbad.txt''' or your ” to the “'''home computertests'''” directory. (overwrite previous contents for both files and use only relative-to-home pathnames).# List 3 unique ways Write a single Linux command to redirect the stdout from the command:<br>'''cat a.txt b.txt c.txt''' to a file called wrong.txt contained in the “'''log-outprojects''' of your Matrix account ” directory and throw-out any standard error messages so they don’t appear on the screen (not including closing the SSH window or applicationappend output to existing file and use only relative pathnames).<br><br># What is the difference between Write a single Linux '''pipeline command''' to display a detailed listing of the '''projects''' directory but pause one screen at a time to view and an argument?navigate through all of the directory contents. Use a relative-to-home pathname.# What is the purpose of Write a single Linux command '''optionpipeline command'''?# What characterto display the sorted contents (sin reverse alphabetical order) is used to of the “'''separatelinux''' commands and arguments?” directory. Use a relative pathname.# Create a Assume that the text file called “'''table.answers.txt''' listing each ” contains 10 lines. Write a single Linux pipeline command, useful options that were mentioned in the online assignment to only displays lines 5 through 8 for this file. Use only relative pathnames.#1 and Write a single Linux '''pipeline command purpose for ''' to only display the contents of the “'''assignments'''” directory whose filenames match the following pattern “'''murray'''” (both upper or lowercase). Use an absolute pathname.# Write a single Linux commands: '''pwdpipeline command''' , to display the number of characters contained in the file called “'''cd.answers.txt''' , ”. Use a relative-to-home pathname.# Write a single Linux '''lspipeline command''' , to display the number of lines contained in the file called “'''calquestions.txt''' , ”. Use a relative pathname.# Write a single Linux '''datepipeline command''' to display only the first 10 characters of each filename contained in your current directory. Also, there is will be a lot of output, so also pause at each screenful so you can navigate throughout the display contents. Use a relative pathname.# Create a '''whotable''' listing each Linux command, useful options that were mentioned in this tutorial for the following Linux commands: '''wcut''' , '''whoamitr''' , '''who am Iwc''' , and '''cleartee'''. _________________________________________________________________________________ Author: Murray Saul License: LGPL version 3Link: https://www.gnu.org/licenses/lgpl.html _________________________________________________________________________________
[[Category:ULI101]]