Training Day : Linux



Similar documents
Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

Tutorial 0A Programming on the command line

Unix Sampler. PEOPLE whoami id who

How To Use The Librepo Software On A Linux Computer (For Free)

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

Fred Hantelmann LINUX. Start-up Guide. A self-contained introduction. With 57 Figures. Springer

Tutorial Guide to the IS Unix Service

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

Command Line - Part 1

USEFUL UNIX COMMANDS

Introduction to Mac OS X

Birmingham Environment for Academic Research. Introduction to Linux Quick Reference Guide. Research Computing Team V1.0

Open Source Computational Fluid Dynamics

University of Toronto

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Linux System Administration on Red Hat

Agenda. Using HPC Wales 2

Computing Service G72. File Transfer Using SCP, SFTP or FTP. many leaflets can be found at:

CS 103 Lab Linux and Virtual Machines

UNIX / Linux commands Basic level. Magali COTTEVIEILLE - September 2009

Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

UNIX (LINUX) PRACTICAL 1 INTRODUCTION

Thirty Useful Unix Commands

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

Partek Flow Installation Guide

An Introduction to the Linux Command Shell For Beginners

A UNIX/Linux in a nutshell

Command Line Crash Course For Unix

Attix5 Pro Server Edition

WinSCP PuTTY as an alternative to F-Secure July 11, 2006

How to install PowerChute Network Shutdown on VMware ESXi 3.5, 4.0 and 4.1

HP-UX Essentials and Shell Programming Course Summary

IUCLID 5 Guidance and support. Installation Guide Distributed Version. Linux - Apache Tomcat - PostgreSQL

Recommended File System Ownership and Privileges

Introduction to Operating Systems

DiskPulse DISK CHANGE MONITOR

4PSA Total Backup User's Guide. for Plesk and newer versions

Tutorial: Using WestGrid. Drew Leske Compute Canada/WestGrid Site Lead University of Victoria

LSN 10 Linux Overview

Unix Guide. Logo Reproduction. School of Computing & Information Systems. Colours red and black on white backgroun

The 2013 Experimental Warning Program (EWP) Virtual Weather Event Simulator (WES) Windows & Linux Installation Documentation

INF-110. GPFS Installation

A Tiny Queuing System for Blast Servers

Hadoop Installation MapReduce Examples Jake Karnes

1. Product Information

Online Backup Client User Manual Linux

L01 Introduction to the Unix OS

Basic Linux & Package Management. Original slides from GTFO Security

High Performance Computing with Sun Grid Engine on the HPSCC cluster. Fernando J. Pineda

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

TEL2821/IS2150: INTRODUCTION TO SECURITY Lab: Operating Systems and Access Control

INASP: Effective Network Management Workshops

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

CSIL MiniCourses. Introduction To Unix (I) John Lekberg Sean Hogan Cannon Matthews Graham Smith. Updated on:

Enterprise Reporting Server v3.5

Introduction to the UNIX Operating System on IT Systems

Introduction to the UNIX Operating System and Open Windows Desktop Environment

CLC Server Command Line Tools USER MANUAL

Automated Offsite Backup with rdiff-backup

NoMachine Enterprise Products, Cloud Server Installation and Configuration Guide

Mobile Labs Plugin for IBM Urban Code Deploy

Command-Line Operations : The Shell. Don't fear the command line...

VERSION 9.02 INSTALLATION GUIDE.

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

RecoveryVault Express Client User Manual

CTERA Agent for Linux

Introduction to Linux operating system. module Basic Bioinformatics PBF

UNIX - FILE SYSTEM BASICS

Linux Crash Course. Prepared by Amgad Madkour

SWsoft Plesk 8.3 for Linux/Unix Backup and Restore Utilities

LECTURE-7. Introduction to DOS. Introduction to UNIX/LINUX OS. Introduction to Windows. Topics:

SWsoft Plesk 8.2 for Linux/Unix Backup and Restore Utilities. Administrator's Guide

Online Backup Linux Client User Manual

How to upload - copy PowerChute Network Shutdown installation files to VMware VMA from a PC

Online Backup Client User Manual

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

Navigating the Rescue Mode for Linux

ULTEO OPEN VIRTUAL DESKTOP V4.0

Syntax: cd <Path> Or cd $<Custom/Standard Top Name>_TOP (In CAPS)

Extreme computing lab exercises Session one

Linux System Administration. System Administration Tasks

Plesk 8.3 for Linux/Unix Acronis True Image Server Module Administrator's Guide

Wavelink Avalanche Mobility Center Linux Reference Guide

Customer Control Panel Manual

OpenGeo Suite for Linux Release 3.0

Secure File Transfer Installation. Sender Recipient Attached FIles Pages Date. Development Internal/External None 11 6/23/08

CMSC 216 UNIX tutorial Fall 2010

Table of Contents. Online backup Manager User s Guide

Parallels Cloud Server 6.0

Online Backup Client User Manual

WES 9.2 DRIVE CONFIGURATION WORKSHEET

PuTTY/Cygwin Tutorial. By Ben Meister Written for CS 23, Winter 2007

Introduction to Unix Tutorial

Getting Started with HPC

Overview. Remote access and file transfer. SSH clients by platform. Logging in remotely

HPCC - Hrothgar Getting Started User Guide

NSave Table of Contents

Transcription:

Training Day : Linux

Objectives At the end of the day, you will be able to use Linux command line in order to : Connect to «genotoul» server Use available tools Transfer files between server and desktop Prepare data files Start processes with command line 2

Planning of the day Part I : 09h00-10h45 Presentation of GenoToul bioinformatics facilities, asking for an account, connection procedure, tree structure of files, command line syntax, TP1 Part II : 11h00-12h30 File types, permissions, manipulating files, displaying files, wildcard characters, disk space control, TP2 Part III : 14h00-17h00 Dowloading/transferring, compressing/uncompressing, utility commands, redirections, TP3 3

Part I Presentation of GenoToul bioinformatics facilities (mission, the team, the users, equipments, disk spaces, website) Introduction to Linux, Creating an account, Tree structure of files, Basic Linux commands, Connection procedure 4

Genotoul Bioinfo Mission Provide to public regional community : Equipment Storage disk space & computers farm Hosting facilities (virtual machine, web site) Services Access to public biologic banks Access to bioinformatics software Training sessions Support 5

Genotoul Bioinfo The team 6

Genotoul Bioinfo The users 650 authenticated users : Regional laboratories (+ some others) (CNRS, INRA, ENSAT, INSERM, INSA, UPS...) Biologists and bio-informaticians 7

Genotoul Bioinfo Equipments Several servers : physical or virtual machines capacities for servers hosting and web services Computational cluster : about 4000 cores, 34 TB memory 2*200 TB disk space available for computing Permanent Storage File System : 2*500 TB disk space capacities (asynchronous replication) 8

Genotoul Bioinfo Disk spaces /usr/local/bioinfo/ Bioinformatics Software /bank/ International genomics Databanks /home/ User configuration files (ONLY) (100 MB user quota) /work/ HPC computational disk space (TEMPORARY) (1 TB user quota) /save/ User disk space (with BACKUP) (250 GB user quota) 9

Genotoul Bioinfo http://bioinfo.genotoul.fr 10

Genotoul Bioinfo Questions=> support.genopole@toulouse.inra.fr 11

Linux Introduction to Linux GNU-Linux : Unix-like operating system Initial Developer = Linus Torvalds (Helsinki) Birth of kernel Linux on 1991 GNU project = free and open source software Over three hundreds of active distributions (large community of developers) Some are commercial : Fedora (RedHat), opensuse(suse), Ubuntu(Canonical), Mandriva 12

Linux Asking for an account 13

Linux Linux account Access to a work environnement Login + password Share resources (Cpu, memory, disk) Usage of software installed Free access to computational cluster Own space disk (/save & /work directory) 14

The tree structure Notion of «Root» usr local / home rose anemone bleuet save work anemone bleuet rose anemone bleuet bioinfo @save @work 15

The tree structure Navigation Tree structure «/» root directory «~» home directory (user) «.» current directory «..» parent directory cd [nom_répertoire] : Change directory Absolute path : /home/bleuet Relative path :../../usr 16

The tree structure Navigation : examples / cd /usr/local usr save work cd bleuet cd./bleuet local rose anemone bleuet cd.. anemone bleuet bioinfo cd../../save/anemone cd /save/anemone 17

The commands : syntax command_name [-option] [parameter] Command_name : what you want to do? Option : how to do it? Parameter : on which? #ls l /home #ls l /home #blastall p blastn i ma_sequence.fasta d ecoli536 #blastall p blastn i ma_sequence.fasta d ecoli536 18

The help on commands command_name -- help man command_name #ls #ls --help --help #blastall #blastall help help #man #man ls ls #man cd #man cd 19

Some basics commands cd : change directory pwd : print working directory ls [nom_répertoire]: list directory contents who : show who is logged on the server passwd : update user's authentication token history : display the commands history 20

How to connect to genotoul? From Windows Xming (Windows graphic) Putty (Connection) From Linux / Mac ssh username@genotoul.toulouse.inra.fr (command line) 21

Very Important Tips Copy / Paste with the mouse Select a text (it is automatically copied) Click on the mouse wheel (the text is pasted where the cursor is located) Command and path completion : Use the TAB key Back to the previous used commands : Use the «up» and «down» keys 22

TP1 Connect yourself to genotoul server with your (training) login/password anemone aster bleuet iris muguet narcisse pensee rose tulipe violette Do the exercices (TP1) 23

Part II Plan File types, File permissions, Manipulating files, Displaying files, wild card characters, Disk space control TP2 24

File Types The «ls» command List the content of a directory ls [-options] [dir_name] -a : display hidden files/dir -l : use the long format -t : sort the content -r : reverse the sort order 25

File Types Read, write,execute Type User Group Others -rwxr-xr-x -rw-r--r-drwxr-xr-x -rwxr-xr-x -rw-r--r-lrwxrwxrwx lrwxrwxrwx 1 1 3 1 1 1 1 cnoirot cnoirot cnoirot cnoirot cnoirot cnoirot cnoirot BIOINFO 123 Jun 14 BIOINFO 3683591 Jun 9 BIOINFO 4096 Jul 8 BIOINFO 20 Apr 16 BIOINFO 954415 Oct 3 BIOINFO 13 Mar 15 BIOINFO 13 Mar 18 17:16 11:56 14:56 11:21 2009 2009 2009 blastforeach.sh Diapo_F10a.odp igv monscript.sh Presentation_pyrocleaner.odp save -> /save/cnoirot work -> /work/cnoirot Permissions Number of elements Owner Group Size Date Name 26

Permissions File permission modification chmod [options] filename modifies the permissions of a file u :user, g : group, o : other, a : all r : read, w : write, x : execute #chmod #chmod g+w g+w file_name file_name ln -s nom_fic_source nom_fic_destination create a symbolic link #ln #ln -s -s file_name file_name link_name link_name 27

Manipulating files File/Dir. Creating and removing mkdir / rmdir [dir_name] : create/remove a directory #mkdir #mkdir dir_name dir_name touch / rm [file_name] : create/remove a file #touch #touch file_name file_name 28

Manipulating files Copying files/dir. cp src_filename dest_filename => copy source file to destination file #cp #cp file1 file1 file2 file2 cp -r src_dirname dest_dirname => copy source dir. to destination dir. #cp #cp -r -r dir1 dir1 dir2 dir2 29

Manipulating files Moving / renaming a file mv source destination Move : #mv file_name existing_dir_name #mv file_name existing_dir_name Rename: #mv old_file_name new_file_name #mv old_file_name new_file_name Move and rename: #mv old_file_name existing_dir_name/new_file_name #mv old_file_name existing_dir_name/new_file_name 30

Manipulating files Finding files/dir. find dirname [-option] [parameter] #find /home/formation name "*.seq" #find /home/formation name "*.seq" #find. type d : only directories #find. type d : only directories #find. type f : only files #find. type f : only files #find / size +1000k : if size > 1Mo #find / size +1000k : if size > 1Mo 31

Manipulating files Wild cards characters? replace any (one) character #ls bov?.seq #ls bov?.seq * replace 0, 1 ou any character #ls *.seq #ls *.seq #rm bacterie* #rm bacterie* [] replace any character between a selection #ls [123]* #ls [123]* #ls f[a c]* #ls f[a c]* 32

Displaying files Display a file content cat file_name : display the file content more file_name : display more and more less file_name : display up and down 33

Text editors Modify a file content vi : standard but difficult nano : easy to use nedit : graphic mode, intuitive emacs : advanced features 34

Disk Space control df [-option] [partition_name] : Show the differences disk spaces #df h : «human format» #df h : «human format» du [-option] [dir_name] : Show the disk usage #du sh : disk space usage #du sh : disk space usage 35

Part II TP Do the exercises 36

Part III Plan Downloading / transferring Compressing / uncompressing Utility commands Data extractions commands Redirections My first script 37

Downloading / transferring Several possible cases Internet browser (http:// + save as) wget http:// Winscp / scp «genotoul» server 38

Downloading / transferring Directly from internet File download from Internet to «genotoul server»: Copy the URL of the file to download #wget http://url.a.telecharger/nom_fichier #wget http://url.a.telecharger/nom_fichier 39

Downloading / transferring Transfer between genotoul and desktop We recommend to use «scp» command (secure copy) scp [user@host1:]file1 [user@host2:]file2 copy file from the network #scp source_name bleuet@genotoul:destination_name #scp source_name bleuet@genotoul:destination_name (copy from desktop to "genotoul") (copy from desktop to "genotoul") WinSCP, Filezilla : copy via graphical interface 40

Downloading / transferring WinSCP / FileZilla 41

Compressing / uncompressing Several formats gzip : compress a file to.gz #gzip #gzip file_to_compress file_to_compress =>gz file creation =>gz file creation gunzip : uncompress a file.gz #gunzip file_to_uncompress.gz #gunzip file_to_uncompress.gz Other formats : bz2, zip, rar, Z 42

Archiving Tar command tar -cvf : archive a file tree #tar cvf formation.tar /home/formation #tar cvf formation.tar /home/formation =>.tar file creation =>.tar file creation tar -xvf : deploy a file tree #tar xvf formation.tar /tmp #tar xvf formation.tar /tmp Tips: combination of tar + gzip (.tgz) tar -cvzf : archive + compression tar -xvzf : uncompress-ion + deploy 43

Utility commands sort [-options] file_name : sort a file #sort n k 1 : num. sort (first col.) #sort n k 1 : num. sort (first col.) wc [-options] file_name : words count #wc c file_name : char. count #wc c file_name : char. count #wc w file_name : words count #wc w file_name : words count #wc l file_name : lines count #wc l file_name : lines count 44

Data extraction Filters (1) cat [-options] file_name : read a file #cat nom_fic1 nom_fic2 > nom_fic_3 #cat nom_fic1 nom_fic2 > nom_fic_3 head [-number] file_name : read the beginning of a file #head 100 file_name (first 100) #head 100 file_name (first 100) tail [-f] [+/-number] file_name : read the end of a file #tail n 100 file_name (100 last lines) #tail n 100 file_name (100 last lines) #tail n +6 file_name (from the 6th line) #tail n +6 file_name (from the 6th line) 45

Data extraction Filters (2) cut [-options] file_name : cuts the fields (vertically) #cut c 1 (gets the first char.) #cut c 1 (gets the first char.) #cut f 2,3 (gets the #2 and #3 fields) #cut f 2,3 (gets the #2 and #3 fields) #cut d " " (separated by the character) #cut d " " (separated by the character) split [-options] file_name (csplit): cuts the fields (horizontally) split l 500 file_name.txt file_name_split. split l 500 file_name.txt file_name_split. 46

Data extraction File Comparison tkdiff [-options] file_name1 file_name2 compare two files (line per line) #tkdiff fic_1 fic_2 #tkdiff fic_1 fic_2 comm [-options] file_name1 file_name2 #comm fic_1 fic_2 #comm fic_1 fic_2 1rst column : only the lines from file_1 1rst column : only the lines from file_1 2nd column : only the lines from file_2 2nd column : only the lines from file_2 3rd column : common lines between the two files 3rd column : common lines between the two files 47

Data extraction Tex research grep [-options] 'motif' file_name[s] Text research tool in the file contents Wild card characters may be used #grep SEQRES fichier_pdb (simple research) #grep SEQRES fichier_pdb (simple research) #grep i (case insensitive) #grep i (case insensitive) #grep c (counts the line amount) #grep c (counts the line amount) #grep v (all the lines except) #grep v (all the lines except) 48

Redirections Standard input / output Most commands use the standard input / output : Standard input = the keyboard Standard output = the console Input / Output (I/O) may be redirected by using the following operators : "<", ">", " ", ">>" 49

Redirections Redirection command > output_file_name redirects the standard output to a new file #grep i Human uniprot.fasta > fic_result #grep i Human uniprot.fasta > fic_result command1 command2 redirects the standard output to another software #grep i Human uniprot.fasta wc l #grep i Human uniprot.fasta wc l command >> output_file_name redirects the standard output to an existing file and appends it #grep i bovin uniprot.fasta >> fic_result #grep i bovin uniprot.fasta >> fic_result 50

My first script A script = a succession of shell commands Put commands into a text file #nedit prog & #nedit prog & Give the execution right #chmod +x prog #chmod +x prog Execute the script #./prog #./prog 51

My first script Automation and plan Win of time (re-utilization) Templates : easy to find on the web Portable (running on all Unix-like systems) Be careful to the syntax between different shell langages (csh,bash...) 52

My first script Run a «blast» for all the fasta files of the directory : #!/bin/bash #DIRNAME REPERTOIRE=$1 #LIST ALL OF FILES LISTE=`ls $REPERTOIRE` echo $LISTE #REPETITION for FILE in $LISTE do blastall -p blastn -i $REPERTOIRE/$FILE -d swissprot -o $FILE.out echo "Blastall sur le fichier : $FILE: ok" done exit 53

Part III TP3 Do the exercises 54