Question: PART 4 : Learn about commands used to view the contents of files. Use the cat command to review the contents of the ~ /

PART 4: Learn about commands used to view the contents of files.
Use the cat command to review the contents of the ~/test2/passwd.bak
Take a screenshot (filename: screenshot_4) of the above activity.
Clear the shell with the clear command.
Resize your terminal window to make it half of the height that it was before by dragging the bottom of the window up.
Now try step 1 again, but use the less command instead of cat. (Use the up and down arrow keys to scroll through the file, type in q, to exit less.)
Return your terminal window to its previous height by dragging the bottom of the window down.
Now try step 1 again, but use the head command instead of cat.
Now try step 1 again, but use the tail command instead of cat.
Try steps 7 and 8 again, but add the -n2 option/flag to the head and tail commands and see what happens.
Type cat > file1 and enter a single sentence about how you feel about Linux. Hit Enter and then type CTRL + d to exit.
Type cat file1 to view its contents.
Create another file with this command ls -la ~ > file50
Append to the end of file50 the contents of ~/test2/passwd.bak using this command cat ~/test2/passwd.bak >> file50
Review the final contents of file50 your work using the less command. You should remember how to exit less.
Search file50 for any lines with the word root by using this command: grep root file50
Take a screenshot (filename: screenshot_5) of the above activities.
Clear the shell with the clear command.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!