Due: Friday, October 13, at 11:59pm
This assignments asks you to exercise basic bash
commands and activities. Students will submit via Gradescope, and may re-submit after viewing the intial auto-grading output. The goal is to ensure that every student has some fundamental shell skills.
This assignment will not teach you all the commands you many need to complete this course. You should use the Linux Pocket Guide and the Linux man
command or the online version of the Linux man pages to find specific commands needed to answer these questions. Use the Pocket Guide to read about related commands and topics.
Google is also useful for locating things, but you need to learn your way around the Guide and the standard Linux documentation, which should be your primary source. Beware that some answers returned by Google are misleading, so use it for more finding the correct direction than for the entire solution.
For this assignment you must use your account on seaside.cs.washington.edu
. This ensure that you have some experience with remote connections, as well as enable the autograder to evaluate your work. See the Linux Resources page on the course web site for more information about connecting to Seaside.
NOTES: Sections are highlighted below for ease of reading only. The autograder will be looking for you to execute a specific set of commands.
Setup: We want to use drive space (memory) that can be accessed from many different machines. This will allow you flexibility with what machine you use at any given time, while retaining access to your files. We accomplish this by making sure we've mounted the udrive, and are working in that drive.
~/
mount the drive by typing mntclassdir cse374
cd cse374
Please note that you may not need to use mntclassdir
every time you log in, but you'll want to make sure you are working in the cse374 directory within your udrive.
script hw1.script
to start recording a transcript of your work.HW1
Linux is great
to the screen.now
now
now
now
file should have three lines in it. Use the wc
command to display the number of lines (and only the number of lines) in the file.now
filenow
file to a file called pastnow
pastnow
file in your folders.man -k
to figure out the name of a command you don't yet know.now
in itnow
file to read, write & execute for the user, and read & execute only for the group and read only for other. You should do this in one step.vi .bashrc
to open the bash resources file in vi.emacs .bashrc
to open the file in emacs.ll
and execute the command you used in step 13ll
emacs
to start emacsctrl-z
to suspend emacsctrl-z
again.grep
to find the phrase "emacs"echo
, and the existing environment variable USER
to print user is great
, with you as the user, to the screen.printenv
, or the value in one variable by entering echo "$VARNAME"
mh75 is great
exit
to stop recording your script.This assignment is worth 40 points. (1-2pts per step above.) There will be an autograder, and you are welcome to resubmit your assignment until you get a perfect score (or until the due date).
Hint 0: It is likely worth while going through the assignment twice. The first time work out what to do at each step. You can use all the resources at your disposal, including lectures and demos, man files, and google. Remember that you can also use the history
command to look at all the commands you have executed - this may help you review your work in preparation for a second run through that you record for submission.
Hint 1: The script
command records everything, even backspaces. If you have too many corrections there will be a lot of extraneous characters if your hw1.script file that may interfere with the autograder. In this case, repeat the exercise carefully avoiding extra key strokes.
Hint 2: There are usually multiple ways to accomplish a task on Linux, and there are many ways you could accomplish the steps for this assignment. If you use one that is too esoteric the autograder will not give you credit. In this situation you should try using something more straight-forward. If you still feel that the autograder is incorrect, please ask the staff to look at it.
Please submit to the Gradescope HW1 assignment. This is linked through Canvas, or you can go directly through Gradescope. You should submit one file, called hw1.script. You will likely want to move your file from Seaside to your local machine, and use the web interface for Gradescope. In order to accomplish this you can use scp: scp
This will move your file to whatever directory you are in when you use it. In the future you can also access files on your udrive as linked above, or use vscode to move files, but it is definitely worth getting scp to work a few times so you know how to use it.