This first lab will introduce you to the Linux operating system in the context of some of the things we have covered in the course so far.
The lab instructor for this course is Sonal Joshi. She will provide contact details etc. at the start of the first lab. She will also advise how to submit your lab deliverable at that time.
This lab is an individual deliverable.
The deliverable for this lab is a PDF of a document you will create as you proceed through the lab. I will ask you to paste screenshots of various things you will observe, as well as answer a number of short questions in this document. You can use OpenOffice or Google Docs for this purpose. The latter will require that you have a Google account and that you login with that account.
Submit your PDF by the end of your lab period.
Login to a Ubuntu Distro in HH 326, or if you want, any Linux Distro if you have one on your own computer. You may also be able to complete the lab using a browser based instance (but I have not tested these). Some options are:
https://copy.sh/v86/?profile=linux26
Take a moment to learn how to take screenshots in your version of Linux. Often a nice screen capture utility is already installed. If you are using an emulated version, you can of course use whatever screen capture functionality you have in your native OS.
Gain some familiarity with Linux OS commands by reading this page:
https://kinsta.com/blog/linux-commands/
Open a blank document for pasting the various responses to the below tasks.
Open a terminal window (CTRL-ALT-T).
Run the following command (i.e. type the bits below into the terminal and hit [enter]):
man man
Read the output and note how to escape from the man output.
What does the man command do? How do you think it might help you?
(You will likely want to use the man command to answer several of the next questions.)
Use the man command to describe what the ps command does and what its various parameters mean.
Then run:
ps
ps aux
ps -ef
Compare the output from these commands and describe their differences.
Run:
top
What information does top provide that ps does not?
Run:
pstree
pstree -p
What do these commands do? Use the man page if necessary.
Determine what the more command does. Then run:
more /proc/cpuinfo
Take a screenshot of the specs portion of the output and paste it in your document.
Answer the following questions:
( you may need to search through the man pages or do some googling to figure out some of these)
a. What is the architecture of your CPU?
b. How much physical memory does your system have?
c. How much of this memory is free?
d. What is the total number of number of forks and context switches since the system booted up?
Run:
sleep 300 &
Then use ps or top to find this process. Take a screenshot and paste it.
Note the <PID> for ps or top, depending on which one you chose to use.
Open another terminal and run the following with that <PID>:
kill <PID>
What happened?
Run top and pick a running <PID>. Then run:
ls /proc/<PID>
What does this command do?
Now run:
cat /proc/<PID>/status
cat /proc/<PID>/cmdline
Take a screenshot of the output and paste it.
What do these two commands do?