linux intro 1 definitions

70
Programming for Evolutionary Biology April 3 rd - 19 th 2013 Leipzig, Germany Introduction to Unix-like systems Part 1: What is Unix? Giovanni Marco Dall'Olio Universitat Pompeu Fabra Barcelona (Spain)

Upload: giovanni-dallolio

Post on 11-May-2015

905 views

Category:

Technology


2 download

DESCRIPTION

Lecture for the "Programming for Evolutionary Biology" workshop in Leipzig 2012 (http://evop.bioinf.uni-leipzig.de/)

TRANSCRIPT

Page 1: Linux intro 1  definitions

Programming for Evolutionary BiologyApril 3rd- 19th 2013Leipzig, Germany

Introduction to Unix-like systemsPart 1: What is Unix?

Giovanni Marco Dall'OlioUniversitat Pompeu Fabra

Barcelona (Spain)

Page 2: Linux intro 1  definitions

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

Page 3: Linux intro 1  definitions

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

Page 4: Linux intro 1  definitions

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

Page 5: Linux intro 1  definitions

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

Page 6: Linux intro 1  definitions

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..

Page 7: Linux intro 1  definitions

What does “Unix” mean?

To solve the problem of computer compatibility, the Bell lab released an operating system called Unix

Page 8: Linux intro 1  definitions

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

Page 9: Linux intro 1  definitions

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

Ken Thompson and Dennis Ritchie, creators of Unix

Page 10: Linux intro 1  definitions

Innovations introduced by Unix

A novel approach to organizing files and scripts Good approach to data analysis Free License for universities and companies

Page 11: Linux intro 1  definitions

Commercial versions of Unix

Solaris   developed by Sun microsystems→ The computers in our room run Solaris Historically used in many multi­processor clusters

BSD   developed by the University of Berkeley→

….

Page 12: Linux intro 1  definitions

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 

Page 13: Linux intro 1  definitions

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

Page 14: Linux intro 1  definitions

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

Page 15: Linux intro 1  definitions

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

Page 16: Linux intro 1  definitions

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

Page 17: Linux intro 1  definitions

GNU/Linux: a free Unix-like system

When it appeared in 1991, GNU/Linux finally provided a free Unix­like operating system

Thanks to the adoption of GNU/Linux servers, Internet grew considerably in 1991­1992, 

Page 18: Linux intro 1  definitions

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)

Page 19: Linux intro 1  definitions

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.

Page 20: Linux intro 1  definitions

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

Page 21: Linux intro 1  definitions

Raise-your-hands time!

Have you ever used a Unix­based operating system before today? 

Page 22: Linux intro 1  definitions

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)

Page 23: Linux intro 1  definitions

While the computer loads: make yourself comfortable!

http://www.codinghorror.com/blog/2007/08/computer-workstation-ergonomics.html

Page 24: Linux intro 1  definitions

This is how your desktop should look like, after logging in:

Page 25: Linux intro 1  definitions

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

Page 26: Linux intro 1  definitions

Our course - computers infrastructure

Page 27: Linux intro 1  definitions

Connecting to evopserver

During this course, we are going to do all the exercises on a remote Fedora server

Let's see how to connect to it

Page 28: Linux intro 1  definitions

Connecting to evopserver

The first thing to do is to launch a terminal emulator● Go to Applications­>Utilities­>Terminal 

Page 29: Linux intro 1  definitions

How does a terminal looks like?

Page 30: Linux intro 1  definitions

Connect to the evopserver

Use the following command to connect to the evopserver:

● “ssh ­X <your_username>@evopserver.bioinf.uni­leipzig.de”

Password:

“HafbbiL!”  (as “Have again fun by bioinf in Leipzig !”)

Page 31: Linux intro 1  definitions

Connect to the evopserver

Use the following command to connect to the evopserver:

● “ssh ­X <your_username>@evopserver.bioinf.uni­leipzig.de”

For example, if your username is giovanni, you should type:

● “ssh ­X [email protected]­leipzig.de” Don't forget the “­X” option!

Page 32: Linux intro 1  definitions

Connecting to the evopserver

The evopserver will ask you to confirm if you want to connect

Type “yes” (not “y”), and press Enter

Page 33: Linux intro 1  definitions

Connecting to the evopserver

Now you should be asked for a password. Enter it and you should be able to access to the evopserver

Page 34: Linux intro 1  definitions

Are you here?

If you have done everything right, you should see something like the following:

Page 35: Linux intro 1  definitions

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

Page 36: Linux intro 1  definitions

Type “nautilus” in the terminal

Page 37: Linux intro 1  definitions

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 [email protected]­leipzig.de

Page 38: Linux intro 1  definitions

nautilus

When you type “nautilus”, you should see a windows showing all the files in the evopserver computer

Page 39: Linux intro 1  definitions

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

Page 40: Linux intro 1  definitions

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 “/”

Page 41: Linux intro 1  definitions

Exercise: look at the file system of a Unix system

Click on “File System” on the left frame

Page 42: Linux intro 1  definitions

Contents of the “root” directory

/bin, /usr, /local, /sys   these folders contain the →software installed

/etc, /var,   system­wide configuration→

/home   contains users' private files→

Other folders   you can ignore them for now →

Page 43: Linux intro 1  definitions

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

Page 44: Linux intro 1  definitions

The home folder

Page 45: Linux intro 1  definitions

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

Page 46: Linux intro 1  definitions

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 drag­drop the unix_course folder

Page 47: Linux intro 1  definitions

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

Page 48: Linux intro 1  definitions

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

Page 49: Linux intro 1  definitions

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:

Page 50: Linux intro 1  definitions

Launching a web browser from evopserver

Some modules of this course will require to use a web browser

Use the command google­chrome on evopserver:

Page 51: Linux intro 1  definitions

Launching a web browser from evopserver

Some modules of this course will require to use a web browser

Use the command google­chrome on evopserver:

Page 52: Linux intro 1  definitions

Restoring the promptafter launching google-chrome

Note that after launching google­chrome, the terminal will not accept commands anymore

To restore it, use the key CTRL­z

Page 53: Linux intro 1  definitions

Restoring the promptafter launching google-chrome

To restore google­chrome, after CTRL­z, use the bg command

Page 54: Linux intro 1  definitions

How can I use a Unix system at my home / lab?

Page 55: Linux intro 1  definitions

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

Page 56: Linux intro 1  definitions

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 

Page 57: Linux intro 1  definitions

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...)

Page 58: Linux intro 1  definitions

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

Page 59: Linux intro 1  definitions

Ubuntu

One of the most popular distributions

Good for novices (doesn't need much extra configuration)

Page 60: Linux intro 1  definitions

BioLinux

Distribution designed for bioinformaticians

When installed, it already contains a lot of bioinformatics tools

Blast, bioperl, etc..

Page 61: Linux intro 1  definitions

Biolinux DVDs

You should have received a DVD of Bio­Linux along with the materials of the course

To use it, insert it in your computer and reboot

Page 62: Linux intro 1  definitions

Fedora

Fedora is another GNU/Linux distribution

Popular in many universities

Page 63: Linux intro 1  definitions

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 bioinformatics­specific software may be a 

bit more difficult

Page 64: Linux intro 1  definitions

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

Page 65: Linux intro 1  definitions

Cygwin

Cygwin can be installed as a standard Windows software

It provides a command line interface, and allows to launch Linux software

Installing non­standard software may be difficult, because you'll need to compile it 

Page 66: Linux intro 1  definitions

Emulating Linux from Windows

A popular emulation software is “virtualbox”

https://www.virtualbox.org/wiki/Downloads

 

Page 67: Linux intro 1  definitions

Connecting to a cluster

putty: allows to connect to a remote server (from Windows)

Page 68: Linux intro 1  definitions

Cloud computing

Cloud computing is a service where you “rent” a remote computer

You pay depending on the CPUs/RAM/time used

Page 69: Linux intro 1  definitions

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

Page 70: Linux intro 1  definitions

Let's have a break!