Running a Linux Distro¶
In order to run a Linux distribution “inside” your Windows installation, you can use a Virtual Machine (VM). A VM is a “virtual computer running inside your computer”.
There are several VM players available. A few options:
There is also a Free & Open Source alternative, QEMU, but it is rather unix-centric and definitely the least user-friendly of the pack.
Now download a Linux distribution. I suggest downloading a user-friendly distribution, such as:
Download the installation image (also called ISO), it represents a CD-ROM or a DVD-ROM.
Now run the VM player and tell it to create a new virtual machine (details depend on the player you use). Tell it to install the Operating System from the installation image you already downloaded. There are several tutorials on how to do this, like this one.
The Linux installation menu will appear on screen. Just follow the instructions.
Hopefully everything will work out, and in a few minutes Linux will be installed in your Virtual Machine.
If you have trouble, try to ask a more experienced computer user (your colleagues, Toma, or me), or search e.g. “how to install Ubuntu on VirtualBox” on Google. There are a lot of useful tutorial online
Unix shell: a few tips¶
The material in this section does not play any role in the exam! It is only given for students to get a bit familiar with the Unix shell.
Opening a shell. When you open a new terminal, a new shell prompt is shown:
The exact text changes between Unix distributions/versions.
In my case, the login text tells me what is the name of my user on the machine
I am using (
stefano), what is the name of the computer I am using
computer), and in what directory I am standing in (in this case my home
The tilde character
~ is just a shorthand for the full path of my home
Running commands. In order to run a command, say
python, it is
sufficient to type:
Enter, and that’s it. In order to quit the terminal, use the
exit command, or press
Control-d on an empty line.
Moving around. From my home, I can move to other directories using the
cd command. For instance, if I am in my home directory
and I type:
I will move to the directory:
The special path
.. can be used to go back up one level, so if I am in:
cd .., I end up in:
At any point in time, I can use the
pwd command to print the path of the
directory I am currently in. For instance, from a newly opened terminal I
$ pwd /home/stefano $ cd Devel/sciprog/lectures $ pwd /home/stefano/Devel/sciprog/lectures $ cd .. /home/stefano/Devel/sciprog
If I use
cd alone (not followed by a path), I will move to the home
directory, irregardless of where I currently am:
$ pwd /home/stefano/Devel/sciprog/lectures $ cd /home/stefano
More information. Of course there are many more things you can do with/from the terminal (most of them, actually), but I won’t write about them. Feel free to consult an online tutorial, like this for further inputs.
Some useful commands:
||Print the directory I am currently in|
||Move to a different directory|
||List contents of the given directory|
||Move a file/directory somewhere else|
||Copie a file/directory|
||Delete a file/directory|
||Create a new directory somewhere|
||Print the contents of a file|
And some useful key presses:
||Kill any running program (may not always work)|
||Means “end-of-data”, useful for exiting the terminal.|
||Cleans the terminal window.|
||Auto-completes the current command/path.|
||Recalls previously used commands.|
||Prints previously used commands on screen.|