Introduction Into Linux Lecture 1 Johannes Werner WS 2017

Similar documents
Introduction to Linux. Roman Cheplyaka

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Introduction to Linux

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Introduction of Linux

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Week 2 Lecture 3. Unix

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Introduction to Unix: Fundamental Commands

Getting your department account

CS197U: A Hands on Introduction to Unix

Introduction: What is Unix?

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

CSCI 2132 Software Development. Lecture 4: Files and Directories

Commands are in black

Perl and R Scripting for Biologists

Chapter-3. Introduction to Unix: Fundamental Commands

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Introduction To. Barry Grant

Linux Essentials Objectives Topics:

Recap From Last Time:

BGGN 213 Working with UNIX Barry Grant

Part 1: Basic Commands/U3li3es

Introduction to UNIX command-line

Unix System Architecture, File System, and Shell Commands

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Computer Systems and Architecture

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Introduction to UNIX command-line II

Open Source Computational Fluid Dynamics

Useful Unix Commands Cheat Sheet

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Working with Basic Linux. Daniel Balagué

CS197U: A Hands on Introduction to Unix

Files

Unix as a Platform Exercises. Course Code: OS-01-UNXPLAT

The Linux Command Line & Shell Scripting

CS 300. Data Structures

A Brief Introduction to Unix

Introduction to Linux

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

d. Permissions 600 on directory dir and 300 on file dir/foo. c. Permissions 700 on directory dir and 200 on file dir/foo.

Files and Directories

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Unix Handouts. Shantanu N Kulkarni

CSC209. Software Tools and Systems Programming.

Introduction to UNIX I: Command Line 1 / 21

(a) About Unix. History

Essential Linux Shell Commands

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Unix Basics. Benjamin S. Skrainka University College London. July 17, 2010

commandname flags arguments

Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.

LING 408/508: Computational Techniques for Linguists. Lecture 5

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

INTRODUCTION TO LINUX

Introduction To Linux. Rob Thomas - ACRC

CISC 220 fall 2011, set 1: Linux basics

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Lab Working with Linux Command Line

3/8/2017. Unix/Linux Introduction. In this part, we introduce. What does an OS do? Examples

Introduction to Linux

EECS2301. Lab 1 Winter 2016

Practical Session 0 Introduction to Linux

Recap From Last Time: Setup Checklist BGGN 213. Todays Menu. Introduction to UNIX.

The Unix Shell & Shell Scripts

Multiple Choice - 58 Questions - 10 of 15%

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Unix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT

Basic Linux Commands. Srihari Kalgi M.Tech, CSE (KReSIT), IIT Bombay. May 5, 2009

CS 143A. Principles of Operating Systems. Instructor : Prof. Anton Burtsev

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Introduction to Linux (and the terminal)

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Introduction To. Barry Grant

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Introduction to Linux Part I: The Filesystem Luca Heltai

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

DAVE LIDDAMENT INTRODUCTION TO BASH

The Unix Shell. Pipes and Filters

Introduction to Linux Workshop 1

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Basic Linux (Bash) Commands

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Introduction to the Linux Command Line

COSC UNIX. Textbook. Grading Scheme

Introduction. File System. Note. Achtung!

LIS Linux/Unix Command Line Goodness

-1- csh cd. cd alias!! ; set prompt=" pwd % " 16 cd. 17 cd.. 18 his /home% set prompt. alias. yasuoka : root :

Linux Systems Administration Shell Scripting Basics. Mike Jager Network Startup Resource Center

Computer Systems and Architecture

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Transcription:

Introduction Into Linux Lecture 1 Johannes Werner WS 2017 Table of contents Introduction Operating systems Command line Programming Take home messages Introduction Lecturers Johannes Werner (j.werner@dkfz-heidelberg.de) Matthias Bieg (m.bieg@dkfz-heidelberg.de) Stephen Krämer (s.kraemer@dkfz-heidelberg.de) Dr. Matthias Schlesner (m.schlesner@dkfz-heidelberg.de) Computational Oncology Group Division of Theoretical Bioinformatics German Cancer Research Center (DKFZ) Course procedure Lecture 9 units, Oct 23 - Nov 17, 2 pm - 3 pm Exercises subsequent to lecture, 3 pm - 6 pm Exam duration: 30 minutes, date will be announced Lecture content 1) Introduction into Linux 2) Introduction into Python 3) Lists and loops 4) File handling 5) Functions 6) Dictionaries & sorting 7) Regular expressions I 8) Modules I 9) Modules II 1

Operating systems What is an operating system? An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. The operating system is a component of the system software in a computer system. Application programs usually require an operating system to function. (... ) Wikipedia 2

What is an operating system? Linux free operating system primarily oriented at command line 498 of TOP500 run with Linux around 600 Linux distributions 3

Command line Insights Characteristics stable and independent from GUI fast lots of tasks can only be performed from the command line functionality directory navigation, search and filter files, extract columns, file conversion,... working with large files combination of different commands simple design of reproducible workflows 4

Getting used to the command line $ pwd $ ls -la $ tail -n 50 /var/log/apache2/error_log $ grep -c ^> sequence.fasta $ blastn -db nt -query sequence.fasta \ -out results.out $ grep -v ^> sequence.fasta while read line; \ do echo -n $line wc -c; done paste -sd+ bc Directory tree Folders. bin boot dev. etc home lib. media mnt opt. proc root sbin. srv tmp usr. var.. Working with directories changing directories listing content of directory showing path of directory $ cd /home/user/data $ cd.. # no arg -> home $ pwd /home/user $ cd data $ pwd /home/user/data $ ls $ ls -a $ ls -R Creating and deleting directories creating directories deleting directories 5

# create folder sequences in current dir $ mkdir sequences # remove empty_folder (if empty) $ rmdir empty_folder # delete non_empty_folder # DANGEROUS! There is no un-rm! $ rm -rf non_empty_folder Getting help $ man gzip $ gzip --help $ gzip -h $ gzip built-in help manual pages searching manual pages $ apropos python ipython python python2 python2.7 python3 python3.5 Creating, copying and deleting files creating files copying and moving files deleting files $ touch empty_file $ cp sequence.fastq sequence_copy.fastq $ mv sequence_copy.fastq backup/ $ cd backup $ mv sequence_copy.fastq sequence.fastq.old $ rm old_file Permissions -rwxr-xr-x 1 sheldon nerd 269 14. Sep 09:30 start.py 6

Permissions -rw-r--r-- -> 644 drwxrwxr-x -> 775 lrwxr-xr-x -> 755 -rw------- -> 600 $ chmod 600 secret.cfg $ chmod -R 755 data_dir $ chmod u=rw file $ chmod g-rx file $ chmod o+r file Output redirections redirection into files output as input for following commands $./analyze_data.sh data.txt > results.txt $./analyze_weather.sh >> weather_stats.txt $ cat unsorted_results.txt sort $./analyze_data.sh data.txt tee results.txt Investigating files concatenate (cat, tac) pager (less, more) view top/end of files $ cat file $ cat file1 file2 > largefile $ tac file $ cat file less $ cat file more $ head -n 50 long_file $ tail -n 50 /var/log/apache2/messages.log Getting enhanced information about files character and line counts (wc) powerful search tool (grep) 7

advanced tools (sed, awk) $ wc -l file $ wc -c sequence.fasta $ grep > sequence.fasta $ grep -c ^@PANCAN reads.fastq $ sed /^#/d script.sh wc -l $ history awk {print $2} sort uniq -c sort -rn head Bash programming #!/bin/bash LOG_DIR=/var/log cd $LOG_DIR cat /dev/null > messages cat /dev/null > wtmp echo "Logs cleaned up." exit 0 Programming Why programming? Programming in bioinformatics development of bioinformatic software data analysis sequence analysis (SNVs, Indel, structural variations) assembly, alignment taxonomic and functional profiling (metagenomics) 16S analysis statistical evaluation Python relatively easy to learn source code readibility wide range of modules interactive shell strongly used in bioinformatics applications 8

Take home messages Take home messages why using Linux in bioinformatics benefits of command line get familiar with command line working with directories getting help copying/moving/deleting files and directories permissions redirections pagers investigating files (cat, head, tail, wc) search tools with regular expressions (grep) 9