Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Operating Systems ClassWork 3 – Ubuntu User Interface Page 1 of 2

Week ___________ Student Name:________________________


Thaina Souza de Paula ID: ______________
21230803

This lab will involve practicing some commands in Terminal interface provided by
Ubuntu OS (Unix type OS).

Download and install virtualbox on your machine (Link on Moodle). Create a


virtual machine using the Ubuntu VDI link on Moodle. Once the machine is
running complete the lab below.

How to open a Terminal (window) for running commands


The icon for the Terminal Emulator is at the bottom of the screen. Click on it and a new
window for the Terminal application is opened. The prompter will indicate your home
directory.
Practicing some commands in the Shell interface.
1. Type in the ls command and then press enter in the Terminal window. This will list
the content of your home directory. What is in your home directory? What was
listed on the screen? In my home directory is listed: Desktop,
Dowloads, Pictures, snap, Videos,
Type ls –l to get a long description of the contents. Documents, Music, Public and Templates.

Type ls | sort to see the list in alphabetical order.

2. Use the mkdir command to make a new directory (folder) called unixstuff in your
home folder by typing mkdir unixstuff

3. What is the command you have to type in in order to see if the directory you have
just created exists? Try it. I used ls -l and my new folder called unixstuff
was listed.
The cd (it stands for change directory) command is used to move within the files and
folders structure on the computer

4. To change your current location into the directory you have just made type in
cd unixstuff and press enter

5. How do you check that you are currently located in the unixstuff directory?
Because now ~/unixstuff is showing before the $

6. To move one level up in the folders structure you have created use the command
cd .. Try it. You current working folder should be now the home folder.

OS_CW3_UI_Unix
7. Move back into the unixstuff subdirectory using cd command.

8. Create a new empty file using the touch command. touch fileone.txt

9. You now want to copy, using the command “cp”, the file fileone.txt that you just
created to make a duplicate file called filetwo.txt
Practice and see what happens when you use the command
When I use this command a new file with the name “filetwo.txt” is created in my
cp fileone.txt filetwo.txt unixstuff folder. I checked it going back to my unixstuff directory and tried the
command ls. Which was showing my two files inside my unixstuff folder.

10. Practice the echo command to see what it does. Hint: read the help manual.

Summary of the Unix commands we have practiced today

man Display the manual for the unix commands


ls List the contents of the current working directory (folder)
cd Changes location of the current working directory
cp Copy one (or more) file(s) into another file, or into an alternate folder
echo Displays the introduced message back on the screen
mkdir Command to create a new directory
pwd Print the name and path for the current working directory

OS_CW3_UI_Unix

Because now ~/unixstuff is showing before the $

You might also like