Resources: GUI: gedit CLI: vi and nano Instructions: Create the files and tasks
ID: 3735500 • Letter: R
Question
Resources: GUI: gedit CLI: vi and nano Instructions: Create the files and tasks for each section. Text Editor vs. Word Processor: A text editor edits plain (ASCII) text. This is readable by any utility that can read clear text/ plain text. A word processor (Microsoft Word or OpenOffice.org Writer, LibreOffice Writer) file is a binary file and unreadable by utilities or software outside of the word processor. We will look at this in section 01 Section 01: Editing files graphically using gedit gedit is located: Menu->Accessories >Text Editor 1. Open gedit to a new blank page. 2. Save the file and name it "gui-file.txt" 3. In the terminal, copy some text into the file to edit the file by running the following command cat /usr/share/dict/words>gui-file.txt 4. Reopen the "gui-file.txt" file and you should have a long list of words. 5. In a graphical text editor, it is very easy to copy and paste and format, similar to a word processor. Highlight a few lines of text, then CTRL+C to copy all the material from the document. Open the LibreOffice Writer application and paste, CTRL+V the previously copied materials into the document. Save the document and name it "wordprocessor.doc" (The 6. doc file extension can be found using the drop-down menu.) Run the following command in the terminal on the two (2) documents: head gui-file.txt wordprocessor.doc Run the following command in the terminal on the two (2) documents: file gui-file. txt wordprocessor.doc 7. 8. The "file" command will give information about the file type. Questions: Give the appropriate responses for each question. What was the difference between the outputs from the head command? (Describe the differences.) 1. 2. What information did you get when you ran the "file" command. 3. What did the head command do? (i.e. What does it do, not what did it output?)Explanation / Answer
1. For the gui-file.txt 10 lines in the file are displayed completely and neatly with the text only that is there in the file, but for the wordprocessor.doc, along with the text it also outputs the font name of the body and font style as well as document summary information and root entry are also given as output.
2. output is:
gui-file.txt: ASCII text, with very long lines
wordprocessor.doc: Composite Document File V2 Document, Little Endian, Os: Windows, Version 1.0, Code page: -535, Revision Number: 6, Total Editing Time: 02:25, Create Time/Date: Fri Mar 23 06:18:33 2018, Last Saved Time/Date: Fri Mar 23 06:21:00 2018
The file command determines the file type of a file. It reports the file type in human readable format as shown above. The file command can also be used on multiple files and will output a separate line to standard output for each file.
3..The head command reads the first few lines of any text provided to it as an input and writes them to output.By default, head returns the first ten lines of each file name that is provided to it.
If more than one input file is provided, head will return the first ten lines from each file, before each set of lines by the name of the file and separate each set of lines by one vertical space.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.