For reference, see the shell slide deck and this reference document in the course GitHub repo.

Questions to Answer#

Q1. Imagine that you have opened a window that gives access to the command line. What command would you use to determine your current location (current path)?

Q2. What command would you use to move to another directory or folder?

Q3. What command would you use to list the contents of the directory or folder?

Q4. You can request a basic list (names of files and directories) and an advanced, or “long” list (that shows permissions, file size, path, etc), by adding the option -l. What command and options would you use to generate the basic list for the folder named shell? What commands and options generate the advanced list?

Q5. Problem: During class, you downloaded and unzipped some course files (see Wk 2 slide no. 60). If you didn’t complete that activity, download the files, unzip them, and keep track of where the files are located. In a command shell window, navigate to the location of those files. Once you are there, print a list of the files in that location. Compare the list of files you see with the list of files listed in the course GitHub repository. Can you identify the same files in both locations?

Q6. Using the full list of files you printed with the “long” list to the command line (in Q4), modify that command so that it would save your list into a file called files-list.txt. What is the command?

Q7. What have you learned about using the command line? Are there situations or tasks where you imagine this environment to be more (or less) useful than the graphical interface of the Explorer or Finder?

What to Turn In#

Turn in a document here on Canvas (plain text, or another format) that has your answers to the questions.

Key#

See the answer key: Lab 02 Key