Open main menu

CDOT Wiki β

Changes

OPS705 Lab 2 (2227)

1,408 bytes removed, 23:46, 13 September 2022
no edit summary
# Issue the following Linux command: <code>cat a.txt</code>
#* Can you see all of the contents?
# Issue the following Linux command: <code>more less a.txt</code>#* NOTE: The <code>moreless</code> command uses the same navigation keys as with the <code>man</code> command. Try using keys that you used to navigate the manual pages.#* What is the advantage of using the more <code>less</code> command?
# Type the letter '''q''' to exit the more command.
# Issue the following Linux command: <code>less a.txt</code>
#* Is there any difference between the more and less commands?
# Type the letter '''q''' to exit the less command.
# Issue the following Linux command: <code>sort a.txt</code>
#* Why does the output not look what you expected? Why?
# Issue the following Linux command: <code>sort -n a.txt</code>
# Try the same command using both the <code>-n</code> and <code>-r</code> options to see what happens.
# Issue the following Linux command: <code>head a.txt</code>
#* What is the output from this command display?
#* What is the output from this command display?
#* How would you issue this command to display only the last line contained in that file?
# Issue the following Linux command: <code>grep 2 a.txt</code> [[Image:end-of-line.png|right|200px|thumb|Edit the '''a.txt''' file and add to the bottom 5 new lines each consisting of the <u>same</u> text: "'''end of line'''".]]
#* What type of output appear? Why did these lines appear (what do they all have in common)?
# Edit the ''a.txt'' file and add to the bottom 5 new lines each consisting of the same text: "end of line" (refer to diagram on right).
# Save your editing session and exit your text editor.
# Issue the following Linux command: <code>uniq a.txt</code>
#* What do you notice happened to those newly created lines?
# Issue the following Linux command: <code>cp a.txt a.txt.bk</code>
# Issue the following Linux command: <code>cp a.txt b.txt</code>
# Issue the following Linux command: <code>file b.txt</code>
#* What sort of information did it provide?
# Issue the following Linux command: <code>diff aa.txt b.txt</code>
#* Was there any output? If not, why?
# Issue the following Linux command: <code>diff aa.txt c.txt</code>
#* What do you think is the purpose of this output?
# Issue the following Linux command: <code>find -P .</code>
#* What is the output of this command?
# Issue the following Linux command: <code>rm aa.txt b.txt a.txt.bk c.txt</code>
# Issue the <code>ls</code> command to verify that these files have been removed.