Classwork 1: Booting Linux
The first encounter with Linux
Assignment 1: submit something
- Boot into Linux (see posted instructions). Log in with your usual UMBC username and password.
- Use cat > joke.txt to store your best (clean) joke or personal motto in a text file. (Type Ctrl-D to end your input.)
- Use cat joke.txt to check that your joke or motto was correctly saved.
- Have neighbor check if joke is funny. If not, rm filename and try another joke or motto.
- Submit using:
submit cs104_chang cw01 joke.txt
- Check your submission with:
submitls cs104_chang cw01
Assignment 2: exploring unix commands
Commands you will use:
pwd, ls, mkdir, cd, cat, more,
less, rm, rmdir, mv, man
Follow the steps below in order. Notice that you are not always given the full command to use. As you move through the exercise, you are given fewer and fewer commands. It's time to think! Use your class notes as a reference.
Creating a Directory Hierarchy (Tree) To Use During the Semester
- Log into your gl account.
- Look at the name of your home directory.
linux1% pwd /afs/umbc.edu/users/p/a/park/home linux1%
- Look at the contents of your home directory. It might contain the
following (and possibly more or less) files and subdirectories:
linux1% ls Mail bin www joke.txt linux1%
- Look at the "long" contents of your home directory. You should see the
same subdirectories, but with more information about each.
linux1% ls -l total 6 drwx------ 2 park rpc 2048 Sep 15 09:04 Mail drwx------ 2 park rpc 2048 Sep 15 09:04 bin -rwx------ 1 park rpc 1024 Sep 15 09:04 joke.txt lrwxr-xr-x 1 park rpc 2048 Sep 15 09:04 www -> ../pub/www linux1%
- Look at the "hidden files in your directory using
- Create a subdirectory called cs104. Verify that it has been created
by again looking at the contents of your home directory.
linux1% mkdir cs104 linux1% ls cs104 Mail bin www joke.txt linux1%
- Move to the cs104 directory. Verify that your current directory
is now indeed cs104 (Remember that linux is case sensitive...so cs104
is different from CS104.)
linux1% cd cs104 linux1% pwd /afs/umbc.edu/users/p/a/park/home/cs104 linux1%
- Create 3 new subdirectories, for the first 3 homework assignments that you will be doing in this class. Call them hw01, hw02 and hw03. Verify that each of the subdirectories has been created.
- Move the joke.txt file you created in your home directory
to the hw01 directory.
Check to see that it is no longer in your home directory.
Then, check to see that it is in the hw01 directory. You should
be in the cs104 directory when you issue these commands.
linux1% pwd /afs/umbc.edu/users/p/a/park/home/cs104 linux1% mv ../joke.txt hw01/ linux1% ls .. cs104 Mail bin www linux1% ls hw01 joke.txt linux1%
- Change directory to the hw01 directory.
Rename your joke.txt file to joke2.txt :
linux1% cd hw01 linux1% mv joke.txt joke2.txt linux1%
Use nano joke2.txt to edit your joke2.txt file and add
the following joke to the end of the file:
Why do ducks have webbed feet? To stamp out fires. Why do elephants have flat feet? To stamp out flaming ducks!
- Submit your new joke2.txt file:
linux1% submit cs104_chang cw01 joke2.txt
- Log out.