Changes

Jump to: navigation, search

Tutorial5: Redirection

701 bytes added, 11:09, 17 January 2021
INVESTIGATION 1: BASICS OF REDIRECTION
# Issue the 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>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep 2 <<+<br>line 1<br>line 2<br>line 3<br>+</span><br><br>What do you notice? How does this differ from the previous command? Why?<br><br>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep 2 > line2.txt <<+<br>line 1<br>line 2<br>line 3<br>+</span><br><br>What do you notice? What is contained in the file '''line2.txt'''? Why?<br><br>'''NOTE:''' You will now run a shell script to confirm that you properly issued Linux commands using redirection.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week4-check-1</span><br><br>
# If you encounter errors and '''re-run''' the checking script until you receive a congratulations message, then you can proceed.<br><br
# Issue the '''ls''' command to see all of the '''temporary files''' that were created as a result of redirection.<br><br>
# Issue a Linux command to '''remove''' those temporary text files in the current directory.<br><br>
13,420
edits

Navigation menu