Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

134 bytes added, 10:32, 11 January 2020
Part 3: Manage / Manipulate Text File Content
# Edit the '''a.txt''' file and add to the bottom 5 new lines each consisting of the <u>same</u> text: "'''end of line'''" and save changes to your file.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">uniq a.txt</span><br><br>What do you notice happened to those newly created lines?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cp a.txt a.txt.bk</span><br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">cp a.txt b.txt</span><br><br>
# Issue one of the commands you learned to display the contents of the file called '''b.txt''' without editing.<br><br>What happened to this file?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">mv a.txt aaa.txt.bk</span><br><br>
# Issue a Linux command to view the directory contents.<br><br>What happened to the file called '''a.txt'''? Why?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">file b.txt</span><br><br>What sort of information did it provide?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">diff aaa.txt.bk b.txt</span><br><br>What was the output? Why do you think caused the result of this output?<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">diff aaa.txt.bk c.txt</span><br><br> What reason would this type of output occur?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">find -P . </span><br><br>What is the output of this command?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">rm aa.txt b.txt a.txt.bk c.txt</span><br><br>
# Issue the ls command to verify that these files have been removed.<br><br>
# After you complete the Review Questions sections to get additional practice, then work on your online assignment, section 2 labelled "Basic Unix Commands" (parts '''4''' to '''6''') in this section which are respectively labelled: '''Managing Files''' , '''Accessing Files''' and '''Review Exercise'''.<br><br>
13,420
edits

Navigation menu