Open main menu

CDOT Wiki β

Changes

Tutorial 5 - Redirection

144 bytes removed, 12:14, 8 June 2023
m
Protected "Tutorial 5 - Redirection": OER transfer ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
=INVESTIGATION 1: BASICS OF REDIRECTION=
<span style="color:red;">'''ATTENTION''': The due date for successfully completing this tutorial (i.e. tutorial 15) is by Friday, March 11 by March 10 @ 11:59 PM (Week 8).</span><br><br>
In this investigation, you will learn how to redirect '''standard input''', '''standard output''' and '''standard error''' when issuing Unix / Linux commands.
# Press <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-d</span> to exit the command.<br><br>
# Issue the '''cat''' command to view the contents of the file: '''output3.txt'''<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cp ~murray.saul/uli101osl640/cars .</span><br><br>
# Issue the '''cat''' command to view the contents of the '''cars''' file.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cut -c1-10 cars</span><br><br>What did this command do?<br><br>
# Issue a Linux command to view the contents of the file called '''output.txt'''<br><br>What does ''grouping'' do when issuing multiple Linux commands (separated by a semi-colon ";") that uses redirection?<br><br>
# Issue the following Linux pipeline command (using \ at the end of most lines):<br><span style="color:blue;font-family:courier;font-weight:bold">echo "This will be split over multiple \<br>lines. Note that the shell will realize \<br>that a pipe requires another command, so \<br>it will automatically go to the next line" |tr '[a-z]' '[A-Z]'</span><br><br>Did the command work? What is the purpose of issuing a Linux command in this way?<br><br>
# After you complete Complete the Review Questions sections to get additional practice, then work on your '''online assignment 2'''<br>and complete '''section3''' labelled: '''Redirection and Pipes'''.
<br><br>