Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project 3 - 4 ESTIMATED TIME: 2 0 minutes OBJECTIVE: View the contents of text files. DESCRIPTION: In this hands - on project, you display
Project
ESTIMATED TIME: minutes
OBJECTIVE: View the contents of text files.
DESCRIPTION: In this handson project, you display file contents using the cat, tac, head, tail, strings, and od commands.
Switch to a commandline terminal tty by pressing CtrlAltF and then log in to the terminal using the user name of root and the password of LINUXrocks!.
At the command prompt, type cat etchosts and press Enter to view the contents of the file hosts, which reside in the directory etc Next, type cat n etchosts and press Enter. How many lines does the file have? At the command prompt, type tac etchosts and press Enter to view the same file in reverse order.
To see the contents of the same file in octal format instead of ASCII text, type od etchosts at the command prompt and press Enter.
At the command prompt, type cat etcservices and press Enter.
At the command prompt, type head etcservices and press Enter. How many lines are displayed, and why?
At the command prompt, type head etcservices and press Enter. How many lines are displayed and why? Next, type head etcservices and press Enter. How many lines are displayed and why?
At the command prompt, type tail etcservices and press Enter. What is displayed on the screen? How many lines are displayed and why?
At the command prompt, type tail etcservices and press Enter. How many lines are displayed and why? Type the cat n etcservices command at a command prompt and press Enter to justify your answer.
At the command prompt, type file binnice and press Enter. What type of file is it Should you use a text tool command on this file?
At the command prompt, type strings binnice and press Enter. Notice that you can see some text within this binary file. Next, type strings binnice less to view the same content pagebypage. When finished, press q to quit the less command.
Type exit and press Enter to log out of your shell.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started