Suppose you’re using your lab UNIX system to write a project summary report, “la
ID: 2246600 • Letter: S
Question
Suppose you’re using your lab UNIX system to write a project summary report, “lab1.2.r” that must not exceed a specified number of words.
The approximate series of events that might take place is shown in the table below. For each step listed in the “Steps” column, you’re to provide the appropriate command in the “Commands” column. You must use only those commands covered so far.
To answer the questions, follow the steps below:
Step 1Log into the lab computer with your asurite username and password, if you're logged off
Step 2Change your working directory to IFT383s17, if you’re not there
Step 3Start capturing your session under filename lab1.script, appending to the previous recording
Step 4Create the file lab1.2 and type in your answers to the questions below. When this file is displayed with the cat command, the lines should be numbered, each number corresponding to the question number. Don’t just type the commands, make a complete sentence that includes the command surrounded by grave-accents. For example, if the first step says: “you write today’s date and time”. Your answer could be something like: “The current date and time is `date`” (12 pts)
Steps
Commands
You write the date in the format “January 20 2015”
You displayed your current working directory
You go to your IFT383s17 directory
You listed the directory contents to see the size of the file
You display the content of “lab1.2.r” file
You rename it as the first draft “lab1.2.r1”
You create a subdirectory called “lab1” to store the first draft
You move “lab1.2.r1” into the “lab1” subdirectory
You make a copy of “lab1.2.r1” and call it “lab1.2.r2”
After editing “lab1.2.r2”, you rename it as “lab1.2.r.final”
You remove the file “lab1.2.v1”
Finally, you count the words in “lab1.2.r.final”
Steps
Commands
You write the date in the format “January 20 2015”
You displayed your current working directory
You go to your IFT383s17 directory
You listed the directory contents to see the size of the file
You display the content of “lab1.2.r” file
You rename it as the first draft “lab1.2.r1”
You create a subdirectory called “lab1” to store the first draft
You move “lab1.2.r1” into the “lab1” subdirectory
You make a copy of “lab1.2.r1” and call it “lab1.2.r2”
After editing “lab1.2.r2”, you rename it as “lab1.2.r.final”
You remove the file “lab1.2.v1”
Finally, you count the words in “lab1.2.r.final”
Explanation / Answer
1) The current date is `date +"%B"$' '"%d"$' '"%Y"`
2) The current working directory is `ls`
3) Going to `cd IFT383s17`
4) The directory contents are `ls -l`
5) Content of “lab1.2.r” file is `cat lab1.2.`
6) Renaming file `mv lab1.2 lab1.2.r1`
7) Making subdirectory `mkdir lab1`
8) Moving `mv lab1.2.r1 lab1`
9) Making a copy `cp lab1.2.r1 lab1.2.r2`
10) Renaming file `mv lab1.2.r2 lab1.2.r.final`
11) Removing file `rm lab1.2.v1`
12) Count of words are `cat lab1.2.r.final | wc -w`
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.