Towards Being a Power User: Unix and Getting To Know Your Computer
Due Monday before class
Objectives
- To review basic Unix commands
- To acquaint you with your computer
Preamble
I don't expect this assignment to take more than about 2 hours, ~1 hour for each part. Use your resources, including the Web, generally. (Note that using the Web is not what I will typically recommend.) If you're taking more than 2 hours, stop and email me.
Part 1: Reviewing Unix Commands
Motivation
In this course, We are moving to intermediate computer science. Using the command-line can make us much more effective/efficient in performing common tasks. Often, tools will have a GUI for most users, and a command-line interface for the more skilled power users (see: git, AWS). We want you to be more comfortable with the command line.
A lot of ideas/tools are based on Unix, its commands, and its philosophy. If you know Unix, then other tools become easier to use because you are familiar with those ideas.
The Task
In a document (text, Word, Google doc), answer the questions below. Try to answer them on your own to start. Then, you can talk to your classmates or look them up. You may find this helpful: Unix commands
Definitions:
- What is a synonym for directory?
- What is a file or directory path?
- What are command-line arguments?
- What are flags with respect to Unix commands? What are they used for?
Paths
- What is a relative path vs an absolute path?
- In Unix commands, how do you refer to the current directory? To the parent directory? To your home directory?
Unix Commands. For each of the following, state the command and then provide an example of using the command.
- How do you find out the path of the current directory?
- How do you go into another directory?
- How do you view the contents of a directory (both the current directory and another directory)?
- How do you create a directory?
- How do you copy a file?
- How do you rename a file?
- How do you delete a file?
- How can you view the contents of a text file?
- How do you find specific (text) content within a set
of text
files (i.e., files that end with
.txt
) in a directory? - How do you combine multiple commands together, e.g., you want the output of the first command to be the input of the second command?
Shortcuts
- In a terminal, what does TAB do?
- In a terminal, what do the up and down arrow keys do?
Part 2: Know Your Computer
Motivation
In computer science, our main tool is a computer. (duh!) As we transition to the intermediate-level, it's important that we know our main tool well so that we can be more proficient and productive.
The Task
In a document (either the same one or a different one), answer the questions below. This is a little tricky because I can't check if your answers are correct. Since I mostly use Mac and Linux, I am not as good with Windows. I can check your answers with you, but the goal is for you to learn your computer. You can ask your classmates for help or look online. We can meet and discuss if you're not sure of the answers.
- What is the path to your home directory? In your file manager GUI, make a shortcut to your home directory. (I believe Windows has that shortcut by default, but IOS doesn't.)
- Where are you going to put your files for this class? (What is the path?)
- How do you open a terminal? (There will be a variety of different ways to do this because there are various "terminals"--some that came with the OS, some that didn't. I just want you to play a bit and learn your computer.)
- Which version of Python are you running (i.e., what is the "x" in Python 3.x)? Describe how you determined that. (There are a variety of ways to do this.)
Optional: Using ssh
You can access other machines from your machine using a secure
shell client (ssh
). While we likely won't make much
use of that capability during this class, it's common in
upper-level courses/more advanced computing.
Set
up your machine to remotely access the lab machines.
Submitting your assignment
Show Professor Sprenkle your assignment at the beginning of class on Monday.
Grading (10 pts)
You will be graded on making a good-faith effort in completing the tasks.