Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen

Similar documents
Perl and R Scripting for Biologists

Linux Command Line Primer. By: Scott Marshall

Introduction to the UNIX command line

Bioinformatics? Reads, assembly, annotation, comparative genomics and a bit of phylogeny.

CSCI 2132 Software Development. Lecture 4: Files and Directories

Linux at the Command Line Don Johnson of BU IS&T

Chapter-3. Introduction to Unix: Fundamental Commands

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

Unix basics exercise MBV-INFX410

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

Short Read Sequencing Analysis Workshop

Mills HPC Tutorial Series. Linux Basics I

Introduction: What is Unix?

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

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

Advanced Linux Commands & Shell Scripting

Introduction to Unix: Fundamental Commands

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

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

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

Introduction to UNIX command-line II

The Unix Shell. Pipes and Filters

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

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Using Linux as a Virtual Machine

CS CS Tutorial 2 2 Winter 2018

Introduction to UNIX command-line

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

Lab Working with Linux Command Line

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

Operating System Interaction via bash

Lab 1 Introduction to UNIX and C

Linux Bootcamp Fall 2015

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

Linux Command Line Interface. December 27, 2017

Introduction to Linux

Lab 1 Introduction to UNIX and C

Helsinki 19 Jan Practical course in genome bioinformatics DAY 0

Linux Systems Administration Getting Started with Linux


Unix - Basics Course on Unix and Genomic Data Prague, January 2017

Introduction to Unix and Linux. Workshop 1: Directories and Files


Introduction to Linux

Chap2: Operating-System Structures

Introduction to Linux (and the terminal)

Introduction to Linux. Fundamentals of Computer Science

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

Introduction to Linux for BlueBEAR. January

Introduction to the Linux Command Line

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

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Unix Workshop Aug 2014

Introduction to Linux

Linux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018

UNIX Essentials Featuring Solaris 10 Op System

Linux Introduction Martin Dahlö Valentin Georgiev

COSC UNIX. Textbook. Grading Scheme

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

A Brief Introduction to Unix

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

Lec 1 add-on: Linux Intro

Session 1: Accessing MUGrid and Command Line Basics

Version Control with Git

DATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan

Why learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.

Introduction to Linux

Introduction to Linux

User Guide Version 2.0

Unix Essentials. BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th

Scripting Languages Course 1. Diana Trandabăț

Modern C++ for Computer Vision and Image Processing. Igor Bogoslavskyi and Cyrill Stachniss

Part I. UNIX Workshop Series: Quick-Start

Linux Introduction Martin Dahlö

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Introduction to Linux Organizing Files

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

Chapter 4. Unix Tutorial. Unix Shell

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

CMU MSP Intro to Hadoop

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

Introduction To. Barry Grant

Introduction to Linux Workshop 1

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

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

Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Lab 2: Linux/Unix shell

The Command Shell. Fundamentals of Computer Science

Unix Introduction to UNIX

Introduction of Linux

Unix System Architecture, File System, and Shell Commands

Transcription:

Working With Unix Scott A. Handley* September 15, 2014 *Adapted from UNIX introduction material created by Dr. Julian Catchen

What is UNIX? An operating system (OS) Designed to be multiuser and multitasking Lots of flavors, some shared characteristics Kernal: core program loaded into memory that controls hardware allocation Standard utility programs: cp to copy, mv to move, etc. Interaction through the shell System configuration files: read by kernal and configuration files. Provide instructions on how to work Frequently have a GUI nowadays, but almost everything can be done without the GUI

Why bother? The tools and concepts discussed today are absolutely necessary for you to install, use and interpret the results from a significant majority of bioinformatic programs today Foundational for all subsequent analysis It just makes you a better person

1000% necessary for bioinformatics

What computers can run Unix? Apple OS X Macs Google s Android phones Most airplane entertainment systems Wireless internet routers

The Terminal Window Make it comfortable to work in: Resize the window Change your font size Open multiple terminal windows

How to get help google unix commands

Textbook

First commands Bourne Again SHell NOTE! There are differences between Linux and Mac OS $ cal $ cal -jy $ man cal NOTE! CoMmaNdS are case-sensitive

Directory Navigation

Hierarchical Folder Structure /root home user bin... handley kwon bin lib data docs

Paths / home user bin... handley virgin bin lib data docs /home/handley/data

Navigation $ pwd $ ls $ mkdir test1 $ cd test1 print working directory list directory contents make directory change directory $ mkdir test1.1 test 1.2 $ cd test1.1 $ pwd

Relative Paths / home user bin... handley virgin bin lib /home/handley/data/ data docs current directory prevous directory

More Navigation $ cd ~ take you home $ cd ~/test1/test1.1 $ cd - previous directory

ls $ cd ~ $ ls $ ls -l $ man ls $ ls -lt ls has lots of options manual pages $ ls -lrt $ ls -lrth

If your typing you are doing it wrong Tab completion Tab once to complete uniquely Tab twice to see all possible options Up/Down arrows Cycle through history $!! $ history $!10

working with text more head tail cat view a text file one screen full at a time view the top 10 lines of a file view the last 10 lines of a file spit the whole file at once space-bar: scroll q: quit -n num controls the number of lines -n num controls the number of lines

Text Editors Wars have been fought over this Complex but powerful Many benefits for coding, not so many for basic text editing Can launch in-line with the terminal. No GUI required Emacs, vi, nano, pico... $ nano filename

Explore a FASTA file

Important File Formats FASTA >HWI-ST0747:162:C03AJACXX:3:1108:19763:106771 1:N:0:! TTTGTCTGCAGGGGGACACGTCAAAGTCAAACGCAGGCAAGTTTGTGTTTATGTCCAGTGGATCTTTTGATTTT! ACATACTGCAGGGTCAGGAGGATTATCTCCTCTGCAAGGTAACGCCTGCTGTAACCGTTGTTCTTCATCCTTTT! CCTAACTGCAGGGCTGTCTTGTCAGGTCTGACAAGACATATGCAGGGCTCAATTTGAGATAATTGCTCAATATA FASTQ @HWI-ST0747:162:C03AJACXX:3:1108:19763:106771 1:N:0:! TTTGTCTGCAGGGGGACACGTCAAAGTCAAACGCAGGCAAGTTTGTGTTTATGTCCAGTGGATCTTTTGATTTT! +! <?@DDDDDHFHHFBB@GGIACFHGGHBGHGCDHBEAHACHI=@CH.=7ACAHHADECDBCC66(6>@C>5@CACCA

Obtaining Example Files wget: retrieves files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. Steps Move to your home directory (cd ~) and make a directory called test_data Move into the test_data directory wget http://evomicsorg.wpengine.netdna-cdn.com/wpcontent/uploads/2014/09/fasta_example.txt wget http://evomicsorg.wpengine.netdna-cdn.com/wpcontent/uploads/2014/09/annot_contigs.txt

Data analysis with pipes STDIN "Input" Program 1 STDOUT "Output"

Plumbing: Connecting pipes Program 1 STDOUT PIPE STDIN Program 2 PIPE Program 3

Explore a FASTA file with Unix commands and pipes $ more fasta_example.txt $ tail fasta_example.txt $ mv fasta_example.txt example.fasta $ nano example.fasta ##ctrl-x to exit How many fasta entires are there in this file?

grep grep: get regular expressions Very powerful! One of your best friends! For our purposes, we will just use it to "get" simple things For example, what can we get to count in a fasta file to enumerate all of the entries? $ grep ">" example.fasta $ grep ">" example.fasta > fasta.headers

Counting and Piping wc: counts words, lines and bytes for stdin $ wc fasta.headers Piping is accomplished with the $ ls -l ~ head -n 3 How can you pipe grep and wc to count the number of fasta entries in example.fasta $ grep ">" example.fasta wc -l Read the man page for grep to find a way that grep can do this without piping to wc

Slice and Dice a Tabdelimited File