Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

128 bytes removed, 16:31, 10 January 2020
Part 3: Manage Text File Content
# View the following table of Text File Management commands Your instructor should have demonstrated in class how to use these commands):<br><table cellpadding="5"><tr><th style="border-bottom: 1px solid black;">Linux Command</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><tr><td>'''touch'''</td><td>Create empty file(s) / Updates Existing File's Date/Time Stamp</td></tr><tr><td>'''cat'''</td><td>Display text file's contents without editing (small files)</td></tr><tr><td>'''more , less'''</td><td>Display / Navigate within large text files without editing</td></tr><tr><td>'''cp'''</td><td>Copy text file(s)</td></tr><tr><td>'''mv'''</td><td>Move / Rename text files</td></tr><tr><td>'''rm'''</td><td>Remove text file(s)</td></tr><tr valign="top"><td>'''diff''' file1 file2</td><td>displays differences between 2 files</td></tr><tr><td>'''file'''</td><td>Gives info about the contents of the file (e.g. file with no extention)</td></tr><tr valign="top"><td>'''find'''</td><td>To find files matching specified characteristics:<table><tr valign="top"><td width="20%">'''find . -name "file*"'''</td><td>lists pathname of any filenames beginning with "file",<br>from the current directory and any subdirectories</td></tr><tr valign="top"><td>'''find . -size +50k'''</td><td>lists pathname of any files larger than 50 kb, from the current directory and any subdirectories</td></tr><tr valign="top"><td>'''find . -mmin -5''' </td><td>lists files modified less than 5 minutes ago</td></tr></table></td></tr></table><br><br>
# Make certain that you are located in your '''home''' directory.<br><br>
# Use the touch command to create the empty files called '''a.txt''', '''b.txt''', and '''c.txt'''<br><br>
# Use the '''nano''' text editor to edit the empty file called '''a.txt'''. <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: file b.txt<br><br>What sort of information did it provide?<br><br>
#In your Matrix account, issue Issue the following Linux command:diff a.txt.bk b.txt<br><br>What was the output? Why do you think caused the result of this output?<br><span style="colorbr># Issue the following Linux command:blue;font-weightdiff a.txt.bk c.txt<br><br> What reason would this type of output occur?<br><br># Issue the following Linux command:bold;fontfind -family:courier"P . <br>~uli101/assign1</spanbr>What is the output of this command?<br><br># At Issue the main menu, select menu option '''2''' labelled '''Basic Unix Commands'''following Linux command: rm b.txt a.txt.bk c.txt<br><br>NOTE: In # Issue the previous tutorial it recommended that you complete parts '''1''''''Bold text''', '''2''' and '''3''' from this section. You need ls command to now complete parts '''4''', '''5''' and '''6''' in this section to learn about Linux commands verify that manage text file contentthese files have been removed.<br><br># Complete 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># Proceed to the next section to perform additional practice. After you have completed '''next week's tutorial''', you should be able to perform the remainder of assignment #1, '''but you need to get a lot of practice with directory and file management'''. Therefore, you should answer all of the questions in the next review section.<br><br>
= LINUX PRACTICE QUESTIONS =
13,420
edits

Navigation menu