ISU Exercise 1
Introduction
In this exercise you will set up the development
environment for I3ISU, i.e. the Ubuntu image that you will use in development.
You will also get some proficiency in the use of the terminal and learn some
basic commands. Finally, you will team up and set up the group wiki.
Goal
When you have completed this exercise, you will:
§
have set up the VMWare Player and the Golden Image
§ have
logged on to Ubuntu
§
have familiarized yourself with the Linux terminal and some useful commands
§ have
created a group wiki
VMWare Player and the Golden Image
Acquiring the Golden Image
§
Fetch (copy) and unpack the Golden Image from K:\staff2stud\EIT-elektro og
IKT\3. Semester\I3ISU\VMWare Golden Image\GoldenImage.zip to your local
harddrive.
Booting Kubuntu
Start VMWare Player and open the Golden Image (In
VMWare Player: File → Open, browse to the directory where you unpacked the
Golden Image). Then turn on the Golden Image virtual machine (green arrow, top
left-hand corner) and watch Kubuntu boot.
Login
When Kubuntu has booted you will be faced with a login
screen. Here you will see that the login name has already been pretyped (stud),
just login using the password stud.
Getting acquainted
with the terminal
Before you start be aware that the shell running in
your terminal is called bash. Help for some of the following jobs can be found
by examining the manual on bash. The manual can examined by running man bash in
the terminal, an alternative is obviously
File & Derectory operations
Open a terminal and write
down which commands you use to
Display the full path of the current
folder:
|
pwd
|
Get a list of all files and folders in
the current folder:
|
ls
-a (all content)
-l (show as a list)
|
Change directory to /home/stud:
|
cd /home/stud
|
Create a directory /home/stud/test:
|
mkdir /home/stud/test
mkdir test (when you’re allready in the
correct folder)
|
Change directory to the subdirectory
/home/stud/test:
|
cd /home/stud/test
cd test (when you’re allready in /home/stud)
|
Create a file text1 containing hello
there using kate:
|
kate text1
|
Create a file text2 containing hello
there using echo2:
|
echo “hello there” >> text2
-e (allows \-commands eg. \n)
|
Append 1234567890 to file text1 using
echo:
|
echo 1234567890 >> text1
|
Dump the contents of text1 to the
terminal window:
|
cat text1
|
Copy text1 to the directory /tmp:
|
cp text1 /tmp
|
Delete text1 and text2 in one go:
|
rm text1 text2
rm text* (* is a wildcard)
rm * (removes everything)
|
Delete the directory /home/stud/test:
|
rmdir test (test must be empty)
rm -rf test (removes without warning)
rm –r test
|
Program
control
Run program the kate in the background:
|
kate &
|
Now kill the program kate you just
started:
|
kill [PID for kate]
|
Write a small shell script that lists
the current directory. Remember to make your shell
script executable using the program
chmod.
1. chmod command:
2.
Shell
script:
|
1.
First create
a shell script.
Next name it filename.sh
Use chmod +x filename.sh to make it executable.
2.
#!/bin/bash
pwd
To execute the file: sh ./filename.sh
(will execute regardless of +x permission)
./filename.sh will execute only if it
has the permission obtained through chmod +x
|
Acquiring system information
Get a list of the currently running processes
(programs):
|
top
ps (process
status)
|
Display the current date and time in the
terminal:
|
date
|
Find the IP address of the network
adapter eth0:
|
ifconfig
eth0
|
Explain what the file /var/log/syslog
does:
|
Contains
systemlogs
|
Try using running less /var/log/syslog
and read the manual for less. What is it good for?:
|
Looking
inside files
|
What happens when you run dmesg?:
|
Shows what
the kernel has loaded. Shows it in the commandwindow
|
Extending the above like this
dmesg|less, what does | do?:
|
Makes a
pipeline from dmesg to less.
The output
of the first program becomes input to the second program, ie the output of
dmesg is shown in the less window
|
Determine the CPU type by looking the
directory /proc:
|
less
/proc/cpuinfo
|
There is a lot of system information to
find in /proc, mention at least 3 different files and
what they tell you:
1. /cpuinfo
2. /crypto
3. /drivers/rtc
|
1.
Info about
the cpu
2.
Kernel´s
known encryptions
3.
Info about
the real time clock
|
Det ser fint ud.
SvarSletDog er I sluppet lidt let fra den sidste del-opgave, da I netop skulle bruge /proc/cpuinfo i forrige del-opgave!
Det kunne være rart med lidt mere uddybende tekst. Hvad mener I f.eks. med wildcard? Det er mest for jeres egen skyld, efetsom I skal op til eksamen i det her.
I behøver nok ikke at smide lærings målene for øvelsen ind, samt forudsætningerne for øvelsen (download af image og login)
Ellers OK herfra
/Gruppe 5 - Dan og Søren