Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full...

25
Introduction to Linux operating system module Basic Bioinformatics PBF

Transcript of Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full...

Page 1: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Introduction to Linux operating system

module Basic Bioinformatics PBF

Page 2: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

What is Linux?

A Unix-like Operating System

A famous open source project

Free to use, distribute, modify under a compatible licence

Produced by a large developer and user community

A combination of many projects

Cost of commercial development estimated at USD 7 billion

Companies often make money by selling:o Supporto Trainingo Custom changes

Page 3: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux distributions

- Ubuntu - Debian- Fedora- Redhat- CentOS- SuSE

- Big list at: http://distrowatch.com

Page 4: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux FUD

hard to install, support for different hardware− try recent distribution (eg. Ubuntu)

it's ugly− Gnome, KDE, XFCE ... (are they all ugly?)

something free can't be good− ?

it works different than Windows− some would call this benefit :-)

Page 5: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

What can it do for you?

Full operating system

Works well on a variety of hardware, including older hardware

You can adapt it to fit your needs

Thousands of programs available

Secure by design

LAMP stack (Linux, Apache, MySQL, PHP)

Supports a wide range of programming languages

Scalable

Page 6: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Where might you find Linux?

Page 7: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

GPL licence and source code

GPL is viral: sharing of changes in GPL software is requirement to the benefit of community

When programmers on the Internet can read, redistribute, and modify the source for a piece of software, it evolves

People improve it, people adapt it, people fix bugs. And this can happen at a speed that, compared to conventional software development, seems astonishing

Page 8: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

History

GNU project started 1984 to produce a Unix-like OS Founded by Richard Stallman Wrote the GNU manifesto in 1985 outlining philosophy Software that is free means more than free of charge

"It means that much wasteful duplication of system programming effort will be avoided. This effort can go instead into advancing the state of the art."

By early 1990s many of the GNU OS utilities were complete

Meanwhile....

Linus Torvalds starts work on the Linux Kernel First version released in 1991 Changes Linux to GPL licence in 1992 Combined with GNU to make an OS

The first “Distros”... 1992 - MCC Interim Linux 1992 - Softlanding Linux System (SLS) 1993 - Debian

Page 9: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux Today

High profile adoptions: French Police French Parliament City of Munich Amazon Google Dreamworks (to produce Shrek)

Preinstalled: Sub notebooks: EEE & OLPC £99 laptop Dell Server hardware

Better support for Linux users

Page 10: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Bioinformatics Information technologies used for biology,

BLAST, HMMER, CLUSTALW... Lots of data, lots of challenges different programming languages specialized libraries

− BioPerl− BioJava− BioPython− BioBike (LISP)

Page 11: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Case Study: SecondLife

Linden Labs uses Linux for SecondLife Servers

Uses 2000 servers

Servers located in San Francisco and Dallas

Uses Debian Linux

CTO: Cory Ondrejka said Debian chosen as can scale massively with a small number of IT staff

Each geographic area corresponds to a processor running software known as a “sim”

Have plans to use more open source tools

Page 12: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux on the desktop

Different desktop systems available Choose the one you like the best! Can adapt to Mac & Windows styles of operation

Page 13: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Naming Files

Files are named by− naming each containing

directory

− starting at the root

This is known as the pathname

/etc/conf1

/home/pero/b

Page 14: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Some Special File Names

Some file names are special:− / The root directory (not to be confused with the root user)

− . The current directory

− .. The parent (previous) directory

− ~ My home directory

Examples:− ./a same as a

− ../pero/x go up one level then look in directory pero for x

Page 15: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux Command Basics

To execute a command, type its name and arguments at the command line

ls -l /etc

Command name Options

(flags)

Arguments

Page 16: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Command: ls

List directory contents ls has many options

− -l long list (displays lots of info)− -t sort by modification time− -S sort by size− -h list file sizes in human readable format− -r reverse the order

“man ls” for more options Options can be combined: “ls -ltr”

Page 17: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Redirecting Output

The output of a command may be sent (piped) to a file:

ls -l > output

“>” is used to specify the output file

Page 18: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Redirecting Input

The input of a command may come (be piped) from a file:

wc < input

“<” is used to specify the input file

Page 19: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

General Syntax: * “*” can be used as a wildcard in unix/linux

Page 20: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

File Commands cp <fromfile> <tofile>

− Copy from the <fromfile> to the <tofile> mv <fromfile> <tofile>

− Move/rename the <fromfile> to the <tofile> rm <file> Remove the file named <file>

mkdir <newdir> Make a new directory called <newdir>

rmdir <dir> Remove an (empty) directory

Page 21: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Other commands

whoami – print the name of the current user id – print information about the current user who – print a list of other users who are logged

in date – print the current date and time on the

server cal – print a calendar for the current month echo – print a text string to the screen

Page 22: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Where to Get Help

You can always read the manual! To see the “man page” for the ls command:

man ls

Page 23: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Windows console

Start -> Run -> cmd d: cd <path> dir > dirlist.txt help dir notepad exit

Page 24: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Download PuTTY

file: putty.exe host: bioserv7.bioinfo.pbf.hr

Page 25: Introduction to Linux operating system - PBFbioserv.pbf.hr/bioinfo/lectures/linuxOS.pdf · Full operating system ... MCC Interim Linux ... print a text string to the screen. Where

Linux commands whoami print effective userid ls list directory contents ls –a man ls an interface to the on-line

reference manuals whatis ls display simple manual

page descriptions pwd print name of current/working

directory cd change directory