SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Essential UNIX Skills for
Biologists
Yannick Pouliot, PhD
Bioresearch Informationist
Lane Medical Library & Knowledge Management Center
1/14/2009

Lane Medical Library & Knowledge Management Center
http://lane.stanford.edu
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 CMGM

Role: Support laboratory researchers regarding
biocomputational resources and their use


…especially postdocs

Contact: lanebioresearch@stanford.edu
Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

2
Goals


Deliver basic understanding of core
UNIX commands



Tips on running UNIX on Mac and Windows
… and on a procedural note,
we’ll be using anonymous
polling to determine whether
you’re happy with the
material and speed of
delivery …
Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

3
But First: LaneConnex -- Your Key to Finding
Resources Quickly

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

4
So, Why UNIX?
UNIX is good for:



performing complex operations with very few key strokes
operating on large number of objects for e.g.,

1.
2.




UNIX is fast…






searching file contents very specifically
renaming files
moving/copying files

Fast running and fast to invoke

LINUX (≈ UNIX) is free and runs on everything

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

5
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 in current directory and
subdirectories! → DON’T

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

DO THIS AT HOME!

6
So How Does One Access UNIX?
Mac: UNIX underlies Mac’s graphical
interface







Applications → Utilities → Terminal

Windows: Must install code (more later)

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

7
Exploring UNIX

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

8
Key UNIX Concepts










UNIX is command-line based (no cute icons).
There are flavors of UNIX
 “Mac” 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
http://lane.stanford.edu

9
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
http://lane.stanford.edu

10
Concept: Metacharacters ***



“*”= 0 or more characters of any kind
‘.’ or ‘?’ = exactly one character of any kind




Exact character depends on the tool…

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
http://lane.stanford.edu

11
Concept: Stringing Commands
Together Using Pipes


“I” = pipe, e.g.:


ls -1 | more

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

12
Polling Time: How’s the speed?
1: Too fast
2. Too slow
3. More or less OK
4. I feel nauseous

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

13
Overview of
Selected UNIX
Commands

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

14
ls [options] [names]

Lists 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 -1
3. create a file that contains a list of the filenames
ls -1 > mylist.txt
4. List files of type with word “example” followed by single character, e.g.,
example1.txt, etc
ls -1 example?.txt
Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

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 +1000 file.txt | more
Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

16
grep: Searching File Contents Using “Regular
Expressions” ****
grep [options] pattern [files]


Very powerful: Searches file contents for presence of a string





grep protein *.pdf
about a million options…

Also searches using regular expressions


Definition: a mathematical expression that expresses the characteristics of
one or more strings, e.g.:

te?xt

*omics

Examples
1. Find all text files whose contents contain words ending in “omics”
(“genomics”, “proteomics”, “transcriptomics”):
grep *omics *.txt

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

17
Polling Time: How’s the speed?
1: Too fast
2. Too slow
3. More or less OK
4. Need coffee

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

18
uniq options filename1 **





Very handy for listing unique (or duplicate) lines in a file
Has options to…
 ignore first or last n fields delimited by tabs or spaces
 compare only the first n characters
Operates ONLY on sorted files

Examples
1. List unique lines using unsorted file
sort test1.txt | uniq

2. Count number of unique instances using sorted file
uniq –c test2.txt

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

19
find [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)
Can search very large numbers of file names, if slowly…

Examples
1. List all files named chapter1 in the /work directory:
find /work -name chapter1 -print
2. Look for filenames in current directory that don't begin with a capital letter
find . ! -name '[A-Z]+' -print

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

20
UNIX on Windows


Easy: UnxUtls





= UNIX “light”
Excellent for most tasks
Not a complete emulation of UNIX
Download here; make sure to follow installation instructions




Hard: Cygwin





More later…

difficult to make it behave perfectly
can run in parallel with Windows

Easier: create a dual boot



Provides ability to boot either Windows or Linux
Requires reboot to go switch…

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

21
Resources
•

UNIX commands:
http://en.wikibooks.org/wiki/Guide_to_Unix/Comm



Another list of UNIX utilities: http://
en.wikipedia.org/wiki/List_of_Unix_utilities

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

22
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
http://lane.stanford.edu

23
UnxUtils Installation: The MiniMe
of UNIX



Download
Installation instructions

→ Let’s do it together if you have
a PC and want it

Lane Medical Library &
Knowledge Management Center
http://lane.stanford.edu

24
Lane Medical Library & Knowledge Management Center
http://lane.stanford.edu

Weitere ähnliche Inhalte

Was ist angesagt? (20)

File handling
File handlingFile handling
File handling
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
 
اسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونیاسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه هفتم کلاس پایتون برای هکرهای قانونی
 
Files in C
Files in CFiles in C
Files in C
 
File handling and Dictionaries in python
File handling and Dictionaries in pythonFile handling and Dictionaries in python
File handling and Dictionaries in python
 
file handling, dynamic memory allocation
file handling, dynamic memory allocationfile handling, dynamic memory allocation
file handling, dynamic memory allocation
 
File management in C++
File management in C++File management in C++
File management in C++
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
File handling in cpp
File handling in cppFile handling in cpp
File handling in cpp
 
C files
C filesC files
C files
 
File handling in C++
File handling in C++File handling in C++
File handling in C++
 
File Management in C
File Management in CFile Management in C
File Management in C
 
File Handling in C++
File Handling in C++File Handling in C++
File Handling in C++
 
File Handling
File HandlingFile Handling
File Handling
 
File handling
File handlingFile handling
File handling
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handling
 
File system node js
File system node jsFile system node js
File system node js
 
Data file handling in python introduction,opening & closing files
Data file handling in python introduction,opening & closing filesData file handling in python introduction,opening & closing files
Data file handling in python introduction,opening & closing files
 

Andere mochten auch

A guided SQL tour of bioinformatics databases
A guided SQL tour of bioinformatics databasesA guided SQL tour of bioinformatics databases
A guided SQL tour of bioinformatics databasesYannick Pouliot
 
LPIC1 02 11 sed
LPIC1 02 11 sedLPIC1 02 11 sed
LPIC1 02 11 sedNoël
 
Standard Safety Instructions 2012
Standard Safety Instructions 2012Standard Safety Instructions 2012
Standard Safety Instructions 2012Uma Mahesh Guraza
 
Kojman
KojmanKojman
KojmanKojman
 
Guia para fundamentación
Guia para fundamentaciónGuia para fundamentación
Guia para fundamentaciónEmilce Alsina
 
The impact of the economy of Gibraltar on the Campo de Gibraltar area
The impact of the economy of Gibraltar on the Campo de Gibraltar areaThe impact of the economy of Gibraltar on the Campo de Gibraltar area
The impact of the economy of Gibraltar on the Campo de Gibraltar areagibraltarcc
 
LogTrek
LogTrek LogTrek
LogTrek logtrek
 
Systems Immunology -- 2014
Systems Immunology -- 2014Systems Immunology -- 2014
Systems Immunology -- 2014Yannick Pouliot
 
Penggunaan software open source di kalangan mahasiswa
Penggunaan software open source di kalangan mahasiswaPenggunaan software open source di kalangan mahasiswa
Penggunaan software open source di kalangan mahasiswaZaien Knight
 
Ringkasan dan jurnal penelitian penggunaan software open source
Ringkasan dan jurnal penelitian penggunaan software open sourceRingkasan dan jurnal penelitian penggunaan software open source
Ringkasan dan jurnal penelitian penggunaan software open sourceZaien Knight
 
Personal Protection in Galvanizing Industry
Personal Protection in Galvanizing Industry Personal Protection in Galvanizing Industry
Personal Protection in Galvanizing Industry rsmahwar
 
What is Credit? An illustrated story.
What is Credit? An illustrated story.What is Credit? An illustrated story.
What is Credit? An illustrated story.creditexaminer
 
Presentation of Gibraltar 04_2010
Presentation of Gibraltar 04_2010Presentation of Gibraltar 04_2010
Presentation of Gibraltar 04_2010gibraltarcc
 

Andere mochten auch (20)

A guided SQL tour of bioinformatics databases
A guided SQL tour of bioinformatics databasesA guided SQL tour of bioinformatics databases
A guided SQL tour of bioinformatics databases
 
LPIC1 02 11 sed
LPIC1 02 11 sedLPIC1 02 11 sed
LPIC1 02 11 sed
 
Guia acordo ort.
Guia acordo ort.Guia acordo ort.
Guia acordo ort.
 
Standard Safety Instructions 2012
Standard Safety Instructions 2012Standard Safety Instructions 2012
Standard Safety Instructions 2012
 
Small rk sb1_pp49-62
Small rk sb1_pp49-62Small rk sb1_pp49-62
Small rk sb1_pp49-62
 
Kojman
KojmanKojman
Kojman
 
Guia para fundamentación
Guia para fundamentaciónGuia para fundamentación
Guia para fundamentación
 
The impact of the economy of Gibraltar on the Campo de Gibraltar area
The impact of the economy of Gibraltar on the Campo de Gibraltar areaThe impact of the economy of Gibraltar on the Campo de Gibraltar area
The impact of the economy of Gibraltar on the Campo de Gibraltar area
 
LogTrek
LogTrek LogTrek
LogTrek
 
Systems Immunology -- 2014
Systems Immunology -- 2014Systems Immunology -- 2014
Systems Immunology -- 2014
 
Penggunaan software open source di kalangan mahasiswa
Penggunaan software open source di kalangan mahasiswaPenggunaan software open source di kalangan mahasiswa
Penggunaan software open source di kalangan mahasiswa
 
Ringkasan dan jurnal penelitian penggunaan software open source
Ringkasan dan jurnal penelitian penggunaan software open sourceRingkasan dan jurnal penelitian penggunaan software open source
Ringkasan dan jurnal penelitian penggunaan software open source
 
Cities
CitiesCities
Cities
 
What is it about
What is it aboutWhat is it about
What is it about
 
Personal Protection in Galvanizing Industry
Personal Protection in Galvanizing Industry Personal Protection in Galvanizing Industry
Personal Protection in Galvanizing Industry
 
What is Credit? An illustrated story.
What is Credit? An illustrated story.What is Credit? An illustrated story.
What is Credit? An illustrated story.
 
Causatives 2° modelo
Causatives 2° modeloCausatives 2° modelo
Causatives 2° modelo
 
Presentation of Gibraltar 04_2010
Presentation of Gibraltar 04_2010Presentation of Gibraltar 04_2010
Presentation of Gibraltar 04_2010
 
Causatives 2° modelo
Causatives 2° modeloCausatives 2° modelo
Causatives 2° modelo
 
Sickle cell
Sickle cellSickle cell
Sickle cell
 

Ähnlich wie Essential UNIX skills for biologists

Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unixAchu dhan
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritpingchockit88
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newanjuchandu755
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newmybrands2
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newshyaminfopvtltd
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newElijahEthaan
 
computer notes - Unix primer
computer notes - Unix primercomputer notes - Unix primer
computer notes - Unix primerecomputernotes
 
linux-lecture1.ppt
linux-lecture1.pptlinux-lecture1.ppt
linux-lecture1.pptNikhil Raut
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338Cam YP Co., Ltd
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.pptKiranMantri
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-oshomeworkping3
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure amol_chavan
 

Ähnlich wie Essential UNIX skills for biologists (20)

Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unix
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Operating system
Operating systemOperating system
Operating system
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 
Uop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet newUop pos 433 week 4 file processing commands worksheet new
Uop pos 433 week 4 file processing commands worksheet new
 
computer notes - Unix primer
computer notes - Unix primercomputer notes - Unix primer
computer notes - Unix primer
 
Basic unix commands1
Basic unix commands1Basic unix commands1
Basic unix commands1
 
linux-lecture1.ppt
linux-lecture1.pptlinux-lecture1.ppt
linux-lecture1.ppt
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Linux introduction-commands2338
Linux introduction-commands2338Linux introduction-commands2338
Linux introduction-commands2338
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
84640411 study-of-unix-os
84640411 study-of-unix-os84640411 study-of-unix-os
84640411 study-of-unix-os
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 

Mehr von Yannick Pouliot

Survey of Spark for Data Pre-Processing and Analytics
Survey of Spark for Data Pre-Processing and AnalyticsSurvey of Spark for Data Pre-Processing and Analytics
Survey of Spark for Data Pre-Processing and AnalyticsYannick Pouliot
 
Managing experiment data using Excel and Friends
Managing experiment data using Excel and FriendsManaging experiment data using Excel and Friends
Managing experiment data using Excel and FriendsYannick Pouliot
 
Ontologically-Aware Automated Gating
Ontologically-Aware Automated GatingOntologically-Aware Automated Gating
Ontologically-Aware Automated GatingYannick Pouliot
 
Why The Cloud Is A Computational Biologist's Best Friend
Why The Cloud Is A Computational Biologist's Best FriendWhy The Cloud Is A Computational Biologist's Best Friend
Why The Cloud Is A Computational Biologist's Best FriendYannick Pouliot
 
There’s No Avoiding It: Programming Skills You’ll Need
There’s No Avoiding It:  Programming Skills You’ll NeedThere’s No Avoiding It:  Programming Skills You’ll Need
There’s No Avoiding It: Programming Skills You’ll NeedYannick Pouliot
 
Ontologies for Semantic Normalization of Immunological Data
Ontologies for Semantic Normalization of Immunological DataOntologies for Semantic Normalization of Immunological Data
Ontologies for Semantic Normalization of Immunological DataYannick Pouliot
 
Predicting Adverse Drug Reactions Using PubChem Screening Data
Predicting Adverse Drug Reactions Using PubChem Screening DataPredicting Adverse Drug Reactions Using PubChem Screening Data
Predicting Adverse Drug Reactions Using PubChem Screening DataYannick Pouliot
 
Repositioning Old Drugs For New Indications Using Computational Approaches
Repositioning Old Drugs For New Indications Using Computational ApproachesRepositioning Old Drugs For New Indications Using Computational Approaches
Repositioning Old Drugs For New Indications Using Computational ApproachesYannick Pouliot
 
Databases, Web Services and Tools For Systems Immunology
Databases, Web Services and Tools For Systems ImmunologyDatabases, Web Services and Tools For Systems Immunology
Databases, Web Services and Tools For Systems ImmunologyYannick Pouliot
 

Mehr von Yannick Pouliot (9)

Survey of Spark for Data Pre-Processing and Analytics
Survey of Spark for Data Pre-Processing and AnalyticsSurvey of Spark for Data Pre-Processing and Analytics
Survey of Spark for Data Pre-Processing and Analytics
 
Managing experiment data using Excel and Friends
Managing experiment data using Excel and FriendsManaging experiment data using Excel and Friends
Managing experiment data using Excel and Friends
 
Ontologically-Aware Automated Gating
Ontologically-Aware Automated GatingOntologically-Aware Automated Gating
Ontologically-Aware Automated Gating
 
Why The Cloud Is A Computational Biologist's Best Friend
Why The Cloud Is A Computational Biologist's Best FriendWhy The Cloud Is A Computational Biologist's Best Friend
Why The Cloud Is A Computational Biologist's Best Friend
 
There’s No Avoiding It: Programming Skills You’ll Need
There’s No Avoiding It:  Programming Skills You’ll NeedThere’s No Avoiding It:  Programming Skills You’ll Need
There’s No Avoiding It: Programming Skills You’ll Need
 
Ontologies for Semantic Normalization of Immunological Data
Ontologies for Semantic Normalization of Immunological DataOntologies for Semantic Normalization of Immunological Data
Ontologies for Semantic Normalization of Immunological Data
 
Predicting Adverse Drug Reactions Using PubChem Screening Data
Predicting Adverse Drug Reactions Using PubChem Screening DataPredicting Adverse Drug Reactions Using PubChem Screening Data
Predicting Adverse Drug Reactions Using PubChem Screening Data
 
Repositioning Old Drugs For New Indications Using Computational Approaches
Repositioning Old Drugs For New Indications Using Computational ApproachesRepositioning Old Drugs For New Indications Using Computational Approaches
Repositioning Old Drugs For New Indications Using Computational Approaches
 
Databases, Web Services and Tools For Systems Immunology
Databases, Web Services and Tools For Systems ImmunologyDatabases, Web Services and Tools For Systems Immunology
Databases, Web Services and Tools For Systems Immunology
 

Kürzlich hochgeladen

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 

Kürzlich hochgeladen (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

Essential UNIX skills for biologists

  • 1. Essential UNIX Skills for Biologists Yannick Pouliot, PhD Bioresearch Informationist Lane Medical Library & Knowledge Management Center 1/14/2009 Lane Medical Library & Knowledge Management Center http://lane.stanford.edu
  • 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 CMGM Role: Support laboratory researchers regarding biocomputational resources and their use  …especially postdocs Contact: lanebioresearch@stanford.edu Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 2
  • 3. Goals  Deliver basic understanding of core UNIX commands  Tips on running UNIX on Mac and Windows … and on a procedural note, we’ll be using anonymous polling to determine whether you’re happy with the material and speed of delivery … Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 3
  • 4. But First: LaneConnex -- Your Key to Finding Resources Quickly Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 4
  • 5. So, Why UNIX? UNIX is good for:  performing complex operations with very few key strokes operating on large number of objects for e.g., 1. 2.    UNIX is fast…    searching file contents very specifically renaming files moving/copying files Fast running and fast to invoke LINUX (≈ UNIX) is free and runs on everything Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 5
  • 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 in current directory and subdirectories! → DON’T Lane Medical Library & Knowledge Management Center http://lane.stanford.edu DO THIS AT HOME! 6
  • 7. So How Does One Access UNIX? Mac: UNIX underlies Mac’s graphical interface    Applications → Utilities → Terminal Windows: Must install code (more later) Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 7
  • 8. Exploring UNIX Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 8
  • 9. Key UNIX Concepts       UNIX is command-line based (no cute icons). There are flavors of UNIX  “Mac” 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 http://lane.stanford.edu 9
  • 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 http://lane.stanford.edu 10
  • 11. Concept: Metacharacters ***   “*”= 0 or more characters of any kind ‘.’ or ‘?’ = exactly one character of any kind   Exact character depends on the tool… 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 http://lane.stanford.edu 11
  • 12. Concept: Stringing Commands Together Using Pipes  “I” = pipe, e.g.:  ls -1 | more Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 12
  • 13. Polling Time: How’s the speed? 1: Too fast 2. Too slow 3. More or less OK 4. I feel nauseous Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 13
  • 14. Overview of Selected UNIX Commands Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 14
  • 15. ls [options] [names] Lists 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 -1 3. create a file that contains a list of the filenames ls -1 > mylist.txt 4. List files of type with word “example” followed by single character, e.g., example1.txt, etc ls -1 example?.txt Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 15
  • 16. 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 +1000 file.txt | more Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 16
  • 17. grep: Searching File Contents Using “Regular Expressions” **** grep [options] pattern [files]  Very powerful: Searches file contents for presence of a string    grep protein *.pdf about a million options… Also searches using regular expressions  Definition: a mathematical expression that expresses the characteristics of one or more strings, e.g.:  te?xt  *omics Examples 1. Find all text files whose contents contain words ending in “omics” (“genomics”, “proteomics”, “transcriptomics”): grep *omics *.txt Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 17
  • 18. Polling Time: How’s the speed? 1: Too fast 2. Too slow 3. More or less OK 4. Need coffee Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 18
  • 19. uniq options filename1 **    Very handy for listing unique (or duplicate) lines in a file Has options to…  ignore first or last n fields delimited by tabs or spaces  compare only the first n characters Operates ONLY on sorted files Examples 1. List unique lines using unsorted file sort test1.txt | uniq 2. Count number of unique instances using sorted file uniq –c test2.txt Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 19
  • 20. find [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) Can search very large numbers of file names, if slowly… Examples 1. List all files named chapter1 in the /work directory: find /work -name chapter1 -print 2. Look for filenames in current directory that don't begin with a capital letter find . ! -name '[A-Z]+' -print Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 20
  • 21. UNIX on Windows  Easy: UnxUtls     = UNIX “light” Excellent for most tasks Not a complete emulation of UNIX Download here; make sure to follow installation instructions   Hard: Cygwin    More later… difficult to make it behave perfectly can run in parallel with Windows Easier: create a dual boot   Provides ability to boot either Windows or Linux Requires reboot to go switch… Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 21
  • 22. Resources • UNIX commands: http://en.wikibooks.org/wiki/Guide_to_Unix/Comm  Another list of UNIX utilities: http:// en.wikipedia.org/wiki/List_of_Unix_utilities Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 22
  • 23. 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 http://lane.stanford.edu 23
  • 24. UnxUtils Installation: The MiniMe of UNIX   Download Installation instructions → Let’s do it together if you have a PC and want it Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 24
  • 25. Lane Medical Library & Knowledge Management Center http://lane.stanford.edu

Hinweis der Redaktion

  1. cd C:Documents and SettingsypouliotMy DocumentsResearchResourcesReferences