Read everything before doing anything.
Note: when these instructions have something to type in italics, substitute your own name or command for what is described. For example, if you see:
echo "your first name"
So, if your name were Thorstein Veblen, you’d type:
echo "Thorstein"
During this lab, you will login to a Linux workstation, play with a few commands, and generally start to get comfortable on a Linux®/UNIX® system. Since we haven’t talked about the commands yet, the purpose of this lab is experimental: try the commands, try to figure out what they do, and try looking them up in either the textbook or online. This assignment will be much easier if you read the textbook first!
When you attended the orientation, you received a login name of the form linuxnnn, where nnn is a three-digit number. To log in to the Linux system from an internet-connected Windows machine, you will have to use a Secure Shell program. We recommend the putty program.
Here are instructions on how to log in.
Type passwd to change your password, then press ENTER. Do not type the word “password” at the command line–it won’t work!
The server prompts you for your old password. Type it in; it will not show up on the screen, not even as little stars.
The server prompts you for the new password. If it is too simple (letters only, or based on a dictionary word), it will tell you so and reject that password
A good password has at least eight characters, made up of letters (upper and lowercase), digits, and punctuation. Try using the first letters of some famous saying or your favorite movie or song. For example, the song title “What is this thing called love?” followed by my oldest cousin’s age would become the password Wittcl?43. Never use your real name, nickname, login name, initials, birth date, or a common dictionary word as a password.
You will want to “rehearse” these steps. Do them a few times until you are sure you know what the correct commands are. Then, do them one more time as the final result to send to the instructor.
Type script a1script at the prompt. That’s the digit one (1) after the letter “a”—this is assignment one, not assignment ell. The system will respond with
Script started, file is a1script
This means that the system will start “recording” all your input and output into a file named a1script.
Type stty -a to see a list of all the attributes of your terminal.
Try typing the letter X, then backspacing over it to see if it gets deleted.
Type whoami to see your username.
Type who to see a list of everyone on the system.
Type finger to see your account and name.
Type finger linuxnnn, (where nnn is your user number) to see more information about your account.
Type date, to see today’s date and the current time.
Type cal to see this month’s calendar.
What files do you have? Type these three commands. Each one produces different output. The third command ends with the letter “ell,” not the digit one.
ls ls -a ls -a -l
What’s the difference? Note: If you have multiple one-letter options, you can combine them. We could have written the last of these commands as ls -al
What’s in a file? Type these commands. The first one is a welcome message, and the second one is a list of all the usernames on the system. It will scroll off the screen.
cat ~linux199/welcome cat /etc/passwd
See a file one page at a time; type less /etc/passwd
Press the spacebar to move forward a page at a time, then q to get back to the command prompt.
Create a file named test1 by typing this:
echo "This is a one-line file" > test1
Type these commands to see that the file exists, and what it contains. Note that the first command has the letter “ell” at the end, not the number one.
ls -l cat test1
Create another file by typing the following; where ^D means CTRL-D.
cat > test2 This is file two. It has several lines. Three lines, in fact. ^D
See that the file exists, and what it contains. The last character in the command is the letter “ell,” not the digit one.
ls -l cat test2
Type sort test2
End the script by typing exit
The system will respond with Script done, file is a1script
Typing exit again will log you off the Linux system.
Email the instructor to let him know you’ve finished the assignment and he can look at your a1script file. (If you look at it yourself, you’ll see lots of hard-to-read stuff. Don’t get stressed about it.) Your email’s subject line must read as follows, or your assignment will not be graded. (Replace nnn with the number portion of your user name.)
CIT050 Assignment 1 - linuxnnn
Thanks to Dr. Stan Isaacs of the College of San Mateo for much of the material in this assignment.