1. Programming for Evolutionary Biology
April 3rd- 19th 2013
Leipzig, Germany
Introduction to Unix-like systems
Part 1: What is Unix?
Giovanni Marco Dall'Olio
Universitat Pompeu Fabra
Barcelona (Spain)
2. Schedule
9.30 – 11.00: “What is Unix?”
11.30 – 12.30: Introducing the terminal
14:30 – 16:30: Grep & Unix philosophy
17:00 – 18:00: awk, make, and question time
3. Schedule
9.30 – 11.00: “What is Unix?”
11.30 – 12.30: Introducing the terminal
14:30 – 16:30: Grep, cut and sort
17:00 – 18:00: Unix philosophy, piping and free
discussion
4. What are Unix, GNU, Linux?
Computer programmers like to use acronyms and
strange names for their software
As a result, in this course you are going to learn a
lot of new difficult words :)
Let's clarify: Unix, GNU and Linux
5. What does “Unix” mean?
Let's go back to the '70s, when computers were very
large like houses
A big problem was that each computer carried a
different operating system: so, a software written
for one computer didn't work in any other
6. What is an operating
system?
The set of all the programs needed to use a
computer properly
A software to coordinate all the components of the
computer (kernel)
A software to draw windows and folders (graphical
interface)
Software to edit texts, browse Internet, install other
software, etc..
7. What does “Unix” mean?
To solve the problem of
computer compatibility,
the Bell lab released an
operating system called
Unix
8. What does “Unix” mean?
To solve the problem of
computer compatibility,
the Bell lab released an
operating system called
Unix
Unix was rapidly adopted
worldwide, and became
the standard operating
system, specially in
universities
9. What does “Unix” mean?
To solve the problem of
computer compatibility,
the Bell lab released an
operating system called
Unix
Unix was rapidly adopted
worldwide, and became
the standard operating
system, specially in Ken Thompson and Dennis Ritchie, creators of Unix
universities
10. Innovations introduced by
Unix
A novel approach to organizing files and scripts
Good approach to data analysis
Free License for universities and companies
11. Commercial versions of Unix
Solaris → developed by Sun microsystems
The computers in our room run Solaris
Historically used in many multiprocessor clusters
BSD → developed by the University of Berkeley
….
12. What is GNU?
In the '80s, commercial versions of Unix started
appearing
As a reaction a group leaded by Richard Stallman at
MIT started developing a new operating system
called GNU
13. What is GNU?
In the '80s, commercial versions of Unix started
appearing
As a reaction a group leaded by Richard Stallman at
MIT started developing a new operating system
called GNU
Richard Stallman, creator of GNU and of the GNU GPL license
14. What is GNU?
GNU is the name of an operating system, inspired
to Unix and distributed as free software
It was never fully completed, but most of its tools
are still used
15. What is GNU?
GNU is the name of an operating system, inspired
to Unix and distributed as free software
It was never fully completed, but most of its tools
are still used
Most of the commands we will see today are GNU
16. What is GNU/Linux?
The original GNU project was never fully
completed
In 1991, it was merged with another project called
Linux, which provided the last component that
missing in GNU
17. GNU/Linux: a free Unix-like
system
When it appeared in 1991, GNU/Linux finally
provided a free Unixlike operating system
Thanks to the adoption of GNU/Linux servers,
Internet grew considerably in 19911992,
18. Resume: Unix, GNU, and
Linux
Unix is the name of an operating system developed
in the '70s
GNU is the name of a operating system, inspired to
Unix but distributed for free, developed in the
'80s
GNU/Linux is a modern operating system, merging
GNU with another project (Linux)
19. Which operating system are
we going to use in this
course?
All the computers in front of you use the Solaris
operating system.
However, we are going to connect to a central
server, where a GNU/Linux system (Fedora) is
installed.
20. What is the difference
between Solaris and
GNU/Linux?
Most of the software will be compatible
Solaris is a commercial system, bundled together
with a specific hardware
22. Hands on Solaris
Let's turn on the computers!
● Username: evop<computer id>
– Example: if your computer is 30, the username is
evop30
● Password: Pro4EvBi (Programming 4 Evolutionary
Biology)
23. While the computer loads:
make yourself comfortable!
http://www.codinghorror.com/blog/2007/08/computer-workstation-ergonomics.html
24. This is how your desktop should
look like, after logging in:
25. The Solaris interface
The Solaris interface is different from Windows and
MacOS, but it should not be difficult to use
● You have a “Launch” menu, from which you can
access all the applications installed
● The interface is similar to an early Windows system
30. Connect to the evopserver
Use the following command to connect to the evopserver:
● “ssh X <your_username>@evopserver.bioinf.unileipzig.de”
Password:
“HafbbiL!” (as “Have again fun by bioinf in Leipzig !”)
31. Connect to the evopserver
Use the following command to connect to the evopserver:
● “ssh X <your_username>@evopserver.bioinf.unileipzig.de”
For example, if your username is giovanni, you should type:
● “ssh X giovanni@evopserver.bioinf.unileipzig.de”
Don't forget the “X” option!
32. Connecting to the
evopserver
The evopserver will ask you to confirm if you want
to connect
Type “yes” (not “y”), and press Enter
33. Connecting to the
evopserver
Now you should be asked for a password. Enter it
and you should be able to access to the
evopserver
34. Are you here?
If you have done everything right, you should see
something like the following:
35. Browsing files in the
evopserver
We will see how to use the terminal later today
For now, let's see which files are in the server
Do to so, type “nautilus” in the terminal
37. Did you get an error when
typing “nautilus” ?
Did you get the following error: “Could not
parse arguments: Can not open display” ?
It means that you forgot to provide the X
option when you connected
Type “exit” to logout, then ssh X
giovanni@evopserver.bioinf.unileipzig.de
38. nautilus
When you type “nautilus”, you should see a
windows showing all the files in the evopserver
computer
39. Nautilus - explanation
“nautilus” is the name
of the software used
to visualize folders in
GNU/Linux
When we type
“nautilus” in the
terminal, we execute
it from the
evopserver computer
40. The Unix file system
All the files in a Unix system are organized in
directories
Directories are organized as a “tree” of diretories
The base directory is called “root” and indicated by
a “/”
41. Exercise: look at the file
system of a Unix system
Click on “File System” on the left frame
42. Contents of the “root”
directory
/bin, /usr, /local, /sys → these folders contain the
software installed
/etc, /var, → systemwide configuration
/home → contains users' private files
Other folders → you can ignore them for now
43. The Home folder
The /home folder contains all the users' folder
If you open it, you will see a different folder for
each of you
● Only the administrator has the right of open other
people's folder
There is a special folder called “evopadmin”, which
contains the materials of the course
45. The course materials
All the course materials are located in the
/home/evopadmin folder
The slides of this module are in
/home/evopadmin/unix_intro
46. Exercise
Copy all the materials of the course in your home
directory
Just open two separate windows, one for your home
and one for /evopadmin, and dragdrop the
unix_course folder
47. What is in the unix_intro
directory?
exercises: files needed for exercises today
slides: all the slides of this module
cheatsheets: some cards to help you remember the
commands we are going to use today
48. Launching a text editor
from evopserver
gedit is a text editor software
You will use it to write scripts in the next modules
of this course
49. Launching a text editor
from evopserver
gedit is a text editor software
You will use it to write scripts in the next modules
of this course
To run it, execute gedit from the command line:
50. Launching a web browser
from evopserver
Some modules of this course will require to use a
web browser
Use the command googlechrome on evopserver:
51. Launching a web browser
from evopserver
Some modules of this course will require to use a
web browser
Use the command googlechrome on evopserver:
52. Restoring the prompt
after launching
google-chrome
Note that after launching googlechrome, the
terminal will not accept commands anymore
To restore it, use the key CTRLz
53. Restoring the prompt
after launching
google-chrome
To restore googlechrome, after CTRLz, use the bg
command
55. The GNU/Linux distributions
There is not a single official “GNU/Linux”
operating system
Rather, there are many “Linux distributions”,
created by different groups of people for different
tasks
56. What is the difference
between linux distributions?
The software included by default when you install the
system
● e.g. some may have a different default text editor
● Some linux distributions include only free software,
others are less strict
● However, all the software available for Linux is
installable in any other distribution
57. What is the difference
between linux distributions?
The software included by default when you install the
system
● e.g.: one linux distribution can have “gedit” as the default
editor, while another has “emacs”
● Some linux distributions include only free software,
others are less strict
● However, all the software available for Linux is
installable in any other distribution
Some technical details such as the libraries used to compile
the software
The default configuration (desktop, windows...)
58. Examples of Linux
Distributions
(2012)
Ubuntu is a popular Linux distribution targeted at
beginners
BioLinux is a Linux distribution targeted at
bioinformaticians
Fedora is a popular Linux distribution, used in
many academic institutions
59. Ubuntu
One of the most
popular distributions
Good for novices
(doesn't need much
extra configuration)
60. BioLinux
Distribution designed
for bioinformaticians
When installed, it
already contains a lot
of bioinformatics
tools
Blast, bioperl, etc..
61. Biolinux DVDs
You should have
received a DVD of
BioLinux along with
the materials of the
course
To use it, insert it in
your computer and
reboot
62. Fedora
Fedora is another
GNU/Linux
distribution
Popular in many
universities
63. Is MacOS an Unix-based
operating system?
Yes, the MacOS system is also inspired to Unix
In principle, you can do bioinformatics and follow
this course on a MacOS system
Installing bioinformaticsspecific software may be a
bit more difficult
64. What if I don't want to
switch from Windows?
Many alternatives:
Cygwin → simulates a Linux environment and
command line from Windows
Emulation → emulate a whole computer, which can
run Linux or other operating systems
Connect to a cluster or a Cloud computing instance
65. Cygwin
Cygwin can be installed as
a standard Windows
software
It provides a command
line interface, and
allows to launch Linux
software
Installing nonstandard
software may be
difficult, because you'll
need to compile it
66. Emulating Linux from
Windows
A popular emulation
software is
“virtualbox”
https://www.virtualbox
.org/wiki/Downloads
67. Connecting to a cluster
putty: allows to
connect to a remote
server (from
Windows)
68. Cloud computing
Cloud computing is a
service where you
“rent” a remote
computer
You pay depending on
the CPUs/RAM/time
used
69. Resume of the session
Unix → Operating system that in the '70s,
introduced innovative approach
Materials of the course → they are all in the
/home/evopadmin folder
GNU/Linux, Fedora, Ubuntu → modern operating
systems inspired to Unix