Command Line Assignment One

Created Wednesday 22 January 2020

I didn't get a chance to show off how the terminal works, but let's see if you are able to explore on your own. This will NOT be graded "strictly," but I do need to see reasonable effort.

This exercise is designed to give you practice with the terminal/command line environment. Some of the below answers may change based on your particular distribution.

  1. Which distribution are you using? Is this using Virtualbox?

  1. Regardless of distribution, you should have access to a terminal program. On your own, figure out how to open it and do so. What is the name of this program in the menu? Once open, see if there is something like an "about" or "help" menu, that may reveal a different name. If different, what is it?

  1. Okay, time to type stuff. You probably aren't seeing a *completely* blank screen, there is likely information about "who" you are and "where" you are next to a flashing cursor. Specifically, what is it telling you?

For the following questions, it may be useful or necessary to refer to the class slides - ../LIS5364-LinuxAndTheShell.pdf

  1. What is the command to "list" files? Run it, and list the files and folders you see. (if this is not a "fresh" install, i.e. you've used it before, feel free to describe, instead)

  1. Next, run the listing command, but with the "-a" flag. You don't need to relist all the files, but you are probably seeing "more stuff." In your own words, try to figure out explain the purpose and result of the difference.

Let's make a new file, called test.txt, with a command-line editor. One command that you could use for this is the “touch” command. However, you can also simply type the name of the editor, then the name of the file. Let's use "nano" —
Type the following:

nano test.txt

then enter. (you may presume an "enter" at the end of all future commands)

This opens the "nano" program. Do the following:

List the directory again, but this time with the “-al” option.

  1. How many bytes is test.txt? (hint: the number you're looking for is close to the date)

Lets get a bigger file; we'll use a very powerful command I did not cover at all.
First just try typing
on a line by itself. That will not actually "do" anything, but it will tell you what it went "wrong."

  1. What are you "missing" according to the error wget just produced?

Next type
man wget

  1. What is "man" short for, here? In a sentence or two, tell me what "wget" is/does.

Okay, next, type the following:

Once it's finished, first try
cat pg23.txt

Next, try
less pg23.txt

9. What is the difference between less and cat, based on what you've seen here?

Let's rename this file to something slightly more descriptive, but still short for us. How about fd.txt?
mv pg23.txt fd.txt

10. quick refresher question: mv can be used to either rename or ____ a file, because on the system they are the same thing?

Okay, lets use some basic commands to play around with this file a bit. A command we did see for a second in class is "sort"

Try typing:
sort fd.txt

  1. Before doing anything else, describe what just happened.

Now, type
less fd.txt

  1. BIG IMPORTANT CONCEPT HERE: Did the file itself change? Try to explain why or why not?

Backlinks: FSU Courses:LIS5364