Lane Medical Library & Knowledge Management Center Essential UNIX Skills for Biologists Yannick Pouliot, PhD Bioresearch Informationist.

Slides:



Advertisements
Similar presentations
By: Tony Andrews.  Linux directory ordering system  Navigating and creating directories ◦ Listing directories and files ◦ Creating directories ◦ Changing.
Advertisements

Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
PacNOG 6: Nadi, Fiji Using Commands in Linux Hervey Allen Network Startup Resource Center.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Lane Medical Library & Knowledge Management Center How to Write a Program Yannick Pouliot, PhD Bioresearch Informationist
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Now, return to the Unix Unix shells: Subshells--- Variable---1. Local 2. Environmental.
Linux+ Guide to Linux Certification, Second Edition
Lane Medical Library & Knowledge Management Center Perl Programming for Biologists SESSION 2: Tue Feb 10 th 2009 Yannick Pouliot,
Guide To UNIX Using Linux Third Edition
T UTORIAL OF U NIX C OMMAND & SHELL SCRIPT S 5027 Professor: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015.
UNIX Filters.
1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Chapter 4: UNIX File Processing Input and Output.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
MCB Lecture #3 Sept 2/14 Intro to UNIX terminal.
Advanced File Processing
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Guide To UNIX Using Linux Fourth Edition
BIF703 stdin, stdout, stderr Redirection. stdin, stdout, stderr Recall the Unix philosophy “do one thing well”. Unix has over one thousand commands (utilities)
Dedan Githae, BecA-ILRI Hub Introduction to Linux / UNIX OS MARI eBioKit Workshop; Nov , 2014.
Linux+ Guide to Linux Certification Chapter Four Exploring Linux Filesystems.
Linux+ Guide to Linux Certification, Third Edition
Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006.
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
UNIX Shell Script (1) Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
Chapter Five Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Using Commands Unix / Linux Preparation Course May 6, 2012 Serrekunda, The Gambia.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
40 Years and Still Rocking the Terminal!
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Using the “CLI” Unix / Linux Preparation Course June 9, 2013 Lusaka, Zambia.
Linux Commands C151 Multi-User Operating Systems.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
UNIX  Portable (common to many computer architectures), multitasking, multi-user operating system  Introduced by Bell labs in mid-1960’s  Thus, much.
Linux 201 Training Module Linux Adv File Mgmt.
Tutorial of Unix Command & shell scriptS 5027
Lesson 5-Exploring Utilities
Some Linux Commands.
C151 Multi-User Operating Systems
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands:
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Guide To UNIX Using Linux Third Edition
Tutorial of Unix Command & shell scriptS 5027
Tutorial Unix Command & Makefile CIS 5027
Yung-Hsiang Lu Purdue University
Presentation transcript:

Lane Medical Library & Knowledge Management Center Essential UNIX Skills for Biologists Yannick Pouliot, PhD Bioresearch Informationist Lane Medical Library & Knowledge Management Center 8/14/2008

Lane Medical Library & Knowledge Management Center 2 The Bioresearch Informationist: At Your Service Yannick Pouliot, PhD, Lane Medical Library & Knowledge Management Center Bioresearch Informationist ≈ computational biologist in residence Lane Library service Closely coordinated with CMGMCMGM Role: Support laboratory researchers regarding biocomputational resources and their use …especially postdocs Contact:

Lane Medical Library & Knowledge Management Center 3 Goals Deliver basic understanding of core UNIX commands Tips on running UNIX on Mac and Windows

Lane Medical Library & Knowledge Management Center 4 But First: LaneConnex -- Your Key to Finding Resources Quickly

Lane Medical Library & Knowledge Management Center 5 Why UNIX? UNIX is good for: 1. performing operations with very few key strokes 2. operating on large number of objects for e.g., searching file contents very specifically renaming files moving/copying files UNIX is fast LINUX(≈ UNIX) is free and runs on everything

Lane Medical Library & Knowledge Management Center 6 UNIX Trip-Ups UNIX is capitalization-sensitive  ls ≠ Ls What you type is what you get  no mistyping!  mind those commands e.g., rm –fr = delete everything below the current directory! → DON’T DO THIS AT HOME!

Lane Medical Library & Knowledge Management Center 7 So How Does One Access UNIX? Mac: UNIX underlies Mac’s graphical interface  access: Applications → Utilities → Terminal Windows: Must install code (more later)

Lane Medical Library & Knowledge Management Center 8 Exploring UNIX

Lane Medical Library & Knowledge Management Center 9 Key Concepts UNIX is command-line based (no cute icons). There are flavors of UNIX  Linux ≈ UNIX “Shell” = command line interface  different shells exist, all with identical basic functionality Anything you can imagine, UNIX can do  … but you may have to think about it… In UNIX, anything can be done in at least three different ways… UNIX has:  commands (built-in) → most of today’s workshop  utilities ≈ “super-commands”, e.g., grep, for parsing text not built-in but usually there

Lane Medical Library & Knowledge Management Center 10 Concept: Redirection *** Redirection operator  “>” or “<“ : add to file (overwrite)  “>>” or “<<“: add to file (don’t overwrite) Applies to both input and output  file.txt > prog.exe  prog.exe > file.txt  File.txt > prog.exe > file1.txt  prog.exe >> file.txt

Lane Medical Library & Knowledge Management Center 11 Concept: Metacharacters *** “*”= 0 or more characters of any kind ‘.’ = exactly one character of any kind Metacharacters can be used with nearly any other command, e.g.,  ls file?.txt  ls file*.txt  ls *.*  more *.txt  grep *omics *.txt NB: There are lots of other kinds of metacharacters…

Lane Medical Library & Knowledge Management Center 12 Concept: Stringing Commands Together Using Pipes “I” = pipe, e.g.:  ls -1 | more

Lane Medical Library & Knowledge Management Center 13 Overview of Selected UNIX Commands

Lane Medical Library & Knowledge Management Center 14 ls [options] [names] **** List contents of directories, including directories themselves  Basically, lists files… When names are provides, lists files contained in a directory name or that match a file name. names can include filename metacharacters. The options display information in different formats. The most useful options include -F, -R, -l, and -s. Examples 1. list all details of all files in current directory ls –l 2. list just the filenames ls create a file that contains a list of the filenames ls -1 > mylist.txt

Lane Medical Library & Knowledge Management Center 15 cat/more/head/tail → commands to look at content of files cat: returns everything more: same but one page at a time **** head: returns top x lines tail: returns bottom x lines all can operate on multiple files Examples 1. show contents of all txt files cat *.txt 2. show first 100 lines of file head +100 file.txt 3. show first 1000 lines of file and paginate: head file.txt | more

Lane Medical Library & Knowledge Management Center 16 grep: Searching File Contents Using Regular Expressions **** grepgrep [options] pattern [files] Searches files for presence of a string  grep protein *.pdf  about a million options… Also searches using regular expressionsregular expressions  Definition: a mathematical expression that expresses the characteristics of one or more strings, e.g.: te?xt *omics

Lane Medical Library & Knowledge Management Center 17 findfind [pathnames] [conditions] *** Very powerful: can specify anything, including exclusions and negations Descends the directory tree beginning at each pathname and locates files that meet the specified conditions. The default pathname is the current directory. Most useful conditions are -name and -type (for general use) Examples 1. List all files named chapter1 in the /work directory: find /work -name chapter1 2. Look for filenames in current directory that don't begin with a capital letter find. ! -name '[A-Z]*'

Lane Medical Library & Knowledge Management Center 18 UNIX on Windows Easy: UnxUtlsUnxUtls  = UNIX “light”  Excellent for most tasks  Not a complete emulation of UNIX Hard: CygwinCygwin  difficult to make it behave perfectly  can run in parallel with Windows Easier: dual boot  ability to boot either Windows or Linux  requires reboot…

Lane Medical Library & Knowledge Management Center 19 Resources UNIX commands: ommands ommands Another list of UNIX utilities:

Lane Medical Library & Knowledge Management Center 20 Everything You Need to Know About UNIX in Short Form: eBooks from Lane The ultimate quick reference for LINUX More than you typically need, but you can zoom into what you need

Lane Medical Library & Knowledge Management Center