Assignment SysProg1
Assignment SysProg1
Assignment 1
Learning Objective
1. To learn “how to create a working Linux environment”.
2. To familiarize with different Install options.
3. To familiarize with the Linux environment.
4. Get to know the basic Linux commands.
Task
1. Install latest build of Ubuntu on your computer.
2. Use your full roll number when prompted for a username.
3. Once you are done with installation, open the terminal.
4. Execute the commands presented in the exercises section and take screenshots of the outputs.
5. Create a single PDF with your roll no as the filename.
6. If you do not execute a command, mention the command and write “Not executed” instead of a
screenshot.
Notes:
1. Commands preceded with $ imply that you should execute the command as a general user - not as
root.
2. Commands preceded with # imply that you should be working as root.
3. Commands with more specific command lines (e.g. “rtrX>" or “mysql>") imply that you are
executing commands on remote equipment, or within another program.
4. If a command line ends with "\" this indicates that the command continues the next line and you
should treat this as a single line.
Instructions
1. Links to detailed Install tutorials are included in lecture 1 slides.
2. Each screenshot should clearly show your username (roll-no).
3. If the command is to be executed as root, before changing to root, execute “whoami”.
4. The output of this command is to be added to any screenshots not clearly showing your roll-no.
CSCP4073 System Programming
Exercises
Log in to your machine.
Become the root user
At the command prompt type the following command:
$ sudo -s
Enter your password when prompted
Now that you are root the command prompt will change. We indicate this using the “#” symbol.
# exit
$
List files:
Use ls to list files:
$ ls -lah
What's inside one of these files?
$ cat .profile
$ less .profile
$ clear
Press “q” to get out of the less display.
If you don't understand what cat, clear or less do, then type:
$ man cat
$ man clear
CSCP4073 System Programming
$ man less
$ history
If you wish to execute one of the commands in the list you saw type:
$ !nn
Where “nn” is the number of the command in the history list. This is useful if you want to run a past
command that was long and/or complicated.
Command completion:
With the bash shell you can auto-complete commands using the tab key. This means, if you type part of
a command, once you have a unique string if you press the TAB key the command will complete. If you
press the TAB key twice you'll see all your available options. Your instructor will demonstrate this, but
give it a try by doing:
$ hist<tab>
$ del<tab><tab>
$ rm <tab><tab> [Include the space after the “rm”]
$ cd
$ ls /sbin | sort > sbin.txt
Now view the contents of what is in sbin.txt to verify that this worked.
$ less sbin.txt
Press the “q” key to quit viewing the contents.
sysadm:x:1000:1000:System Administrator,,,:/home/sysadm:/bin/bash
CSCP4073 System Programming
userid:passwd:uid:gid:Name,extrastuff,,:HomeDir:LoginShell
grep is often used with a pipe to FILTER the output of commands. For instance:
$ history | grep ls
Will display your previous use of the ls command from exercise 2.
This might take a few moments if everyone in class is doing this at the same moment.
The joe editor package just like vi. Try using the editor to create a new file in your home directory:
$ cd
$ joe newfile.txt
Install the postfix mailerver software and some mail utilities
At the command line type:
Several tools will use the postfix mailserver during the week. In addition, we will use a number of the
mail utilities (such as mail) and you will use the mutt email reader later in the week.