Linux intro 1 definitions

Post on 11-May-2015

904 views 2 download

Tags:

description

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

transcript

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)

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

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

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

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

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

What does “Unix” mean?

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

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

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

Innovations introduced by Unix

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

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→

….

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 

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

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

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

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

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, 

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)

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.

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

Raise-your-hands time!

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

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)

While the computer loads: make yourself comfortable!

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

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

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

Our course - computers infrastructure

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

Connecting to evopserver

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

How does a terminal looks like?

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 !”)

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 giovanni@evopserver.bioinf.uni­leipzig.de” Don't forget the “­X” option!

Connecting to the evopserver

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

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

Connecting to the evopserver

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

Are you here?

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

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

Type “nautilus” in the terminal

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.uni­leipzig.de

nautilus

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

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

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

Exercise: look at the file system of a Unix system

Click on “File System” on the left frame

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 →

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

The home folder

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

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

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

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

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:

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:

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:

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

Restoring the promptafter launching google-chrome

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

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

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

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 

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

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

Ubuntu

One of the most popular distributions

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

BioLinux

Distribution designed for bioinformaticians

When installed, it already contains a lot of bioinformatics tools

Blast, bioperl, etc..

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

Fedora

Fedora is another GNU/Linux distribution

Popular in many universities

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

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

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 

Emulating Linux from Windows

A popular emulation software is “virtualbox”

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

 

Connecting to a cluster

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

Cloud computing

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

You pay depending on the CPUs/RAM/time used

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

Let's have a break!