Perl and R Scripting for Biologists

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

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

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

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Linux for Beginners. Windows users should download putty or bitvise:

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

Computer Systems and Architecture

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

Introduction to UNIX command-line

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

Introduction to Linux

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

Introduction to Linux

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

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

Introduction: What is Unix?

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

Introduction to Linux

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

Computer Systems and Architecture

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Linux Command Line Primer. By: Scott Marshall

Lab 2: Linux/Unix shell

Introduction to Linux

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

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

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

Linux Essentials Objectives Topics:

Linux Systems Administration Getting Started with Linux

UNIX Kernel. UNIX History

Unix Handouts. Shantanu N Kulkarni

CISC 220 fall 2011, set 1: Linux basics

Introduction of Linux

EECS2301. Lab 1 Winter 2016

Chapter 1 - Introduction. September 8, 2016

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

Introduction To Linux. Rob Thomas - ACRC

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Mills HPC Tutorial Series. Linux Basics I

Introduction to Linux

CS246 Spring14 Programming Paradigm Notes on Linux

Linux Command Line Interface. December 27, 2017

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

ScazLab. Linux Scripting. Core Skills That Every Roboticist Must Have. Alex Litoiu Thursday, November 14, 13

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

Introduction To. Barry Grant

Command-line interpreters

Files and Directories

Chapter-3. Introduction to Unix: Fundamental Commands

INTRODUCTION TO LINUX

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

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

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

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

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

Working with Basic Linux. Daniel Balagué

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

Introduction to Linux

Chap2: Operating-System Structures

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

XSEDE Scholars Program Introduction to the Linux Environment. Tips and Tricks for Linux Users John Lockman III June 5 th, 2012

The Unix Shell. Pipes and Filters

Unix Tutorial Haverford Astronomy 2014/2015

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

Introduction to Linux

Introduction to Unix: Fundamental Commands

Introduction. Let s start with the first set of slides

Version Control with Git

EE516: Embedded Software Project 1. Setting Up Environment for Projects

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

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

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

An Introduction to Unix Power Tools

CSE 391 Lecture 1. introduction to Linux/Unix environment

A Brief Introduction to Unix

CSCI 2132 Software Development. Lecture 5: File Permissions

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

Introduction to the Linux Command Line January Presentation Topics

Unix Basics. Systems Programming Concepts

Introduction to Linux Workshop 1

Getting started with Hugs on Linux

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

Introduction to Cygwin Operating Environment

CS197U: A Hands on Introduction to Unix

Unix System Architecture, File System, and Shell Commands

5/20/2007. Touring Essential Programs

Unix Introduction to UNIX

LAB #7 Linux Tutorial

System Programming. Introduction to Unix

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

Introduction to Linux Organizing Files

The UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute

Introduction to the shell Part II

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

Getting started with Hugs on Linux

CSE 390a Lecture 1. introduction to Linux/Unix environment

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

Transcription:

Perl and R Scripting for Biologists Lukas Mueller PLBR 4092

Course overview Linux basics (today) Linux advanced (Aure, next week)

Why Linux? Free open source operating system based on UNIX specifications Popular in servers and in bioinformatics UNIX created in 1970s by Bell Labs Ken Thompson and Dennis Ritchie inventors of UNIX at Bell labs in front of PDP-11 Linux: Linus Torvalds in 1990s

Operating Systems

Linux Distributions Around the Linux kernel, several distributions (distros) were created Contain administration tools (package managers) and other software Main Distros Red Hat (rpm) Debian (apt) Ubuntu (derived from Debian) Lots of others

Linux

UNIX the terminal

The Shell Runs in a terminal Command Line Interface (CLI) executing commands (such as ls) Built-in scripting language Different types sh, csh, tcsh, bash Linux and MacOS both use bash by default

Anatomy of a UNIX command $ls -l -C auto --all /home Command line prompt Simple option flag (short form) command Option (long form) Option with argument Argument

Working with the shell Type and execute commands Editing: control-a, control-e, control-k, control-d Beginning, end, delete rest of line, delete character Interrupting, terminating execution (control-z, control-c) Viewing running jobs (jobs) Background/foreground jobs (bg, fg, &) History (up key, control-r, history,!,!!, etc) Autocompletion (tab and tab-tab)

Multiuser sytems UNIX can accommodate several users on a system Every user can own files and processes (permissions) Users can also be part of one or more groups Groups also have permissions Users need to login before using the system (authentication) home dir - usually /home/username

UNIX file system Hierarchical filesystem Folders (directories in UNIX-speak) are separated by / / is the root Paths starting with / are absolute (ie /etc/apt/sources.list) Paths not starting with / are relative (ie Desktop/ ) to the current directory Commands: pwd, ls, cd ~/ denotes the home directory, for example /home/mueller/.. refers to the directory above the current directory

File system layout Main higher-level system dirs (exact layout depends on distribution /bin & /lib - code and code libraries /usr - more code and libraries /var /home user directories, eg. /home/bioinfo/ /tmp - temporary files /etc /proc - special file system in Linux - logs and other data - configuration information

Superuser permissions UNIX has one superuser, called root Root has infinite privileges On modern systems like Ubuntu and MacOS, this user has been deactivated (security hazard) These systems use sudo instead Prefix command to be run as superuser with sudo sudo ls -al /var/log/ Or, obtain a root shell: sudo -s The password is your account password. Be careful with sudo!!!!!!! Only use when necessary!

UNIX - processes Every running program is treated as a process Every process has a process ID and an environment Processes are created only from other processes through fork. (parent ID) First process is init, with process ID 1 Viewing processes: ps, jobs, top Terminating processes: kill

Viewing running processes top Shows all processes as a self updating list ps Outputs process information to STDOUT. Try: ps -elf Linux: The /proc filesystem Do an ls /proc every number is a dir correspondig to a running process. The dir contains more data.

less $ less textfile.txt less commands Searching: / Page down: spacebar, Page up: b Beginning of file: < End of file: > Goto line: line number Quit: q

Man pages Man pages are the documentation for UNIX commands $ man <command> $ man ls Searching man pages Use the apropos command $ apropos text editor

grep Matches a pattern in a file $ grep <pattern> <file> Or $ cut -f1 <file> grep pattern less Options -v the complement set (non-matching lines) -i case insensitive matching Pattern Is a regular expression (see later)

Pipes and redirects <, > STDIN and STDOUT STDIN is by default the keyboard STDOUT is by default the screen Pipes can capture the STDOUT output of a program and feed it into the STDIN of another program For example $ ls sort less

sed Stream editor Allows to modify streams Match and replace: cat README.txt sed 's/linux/xxxxx/' less

Summary of popular UNIX commands Help: man, info, apropos File system: ls, cd, mkdir, rmdir, cp, mv, find, rm Files: more, less, cat, wc, ln Permissions: chmod, chown, chgrp Processes: jobs, top, ps, fg, bg Text handling: grep, cut, sort, uniq Internet: ftp

FTP ftp ftp.solgenomics.net Anonymous access Username: ftp (or anonymous) Password: your email address List files: ls Change directories: cd Change local directory: lcd Toggle passive mode: passive Download a file: get <file>

Editing programs: emacs Why not use Microsoft Word? Embedded control characters in file formats No syntax highlighting / auto indentation No integration with other development tools Some tools: Emacs Vi, vim, gvim Eclipse Xcode (Apple)

Using emacs Command: emacs Opens a new window if X-window system present Visit file: control-x control-f Save file: control-x control-s Save as another file: control-x control-w Close program: control-x control-c Cancel operation: control-g Search forward: control-s Modes: automatic detection of Perl-mode