VERY SHORT INTRODUCTION TO UNIX

Size: px
Start display at page:

Download "VERY SHORT INTRODUCTION TO UNIX"

Transcription

1 VERY SHORT INTRODUCTION TO UNIX Tore Samuelsson, Nov An operating system (OS) is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of the computer that acts as a host for computing applications run on the machine. Examples are Linux (UNIX), Windows XP, Mac OSX. Connecting to UNIX computer. Use an ssh client (like putty) to connect to a remote computer with a unix operating system. You may also encounter unix in the context of a local computer. If you have a Mac (OSX) you can open a terminal window to have access to unix commands (Applications- Utilities). If you want to use unix on a Windows computer Cygwin ( is recommended. File system Examples of directories / root of file system /bin executable binary files /dev special files used to represent real physical devices /etc commands and files used for system administration

2 /home contains a home directory for each user of the system /lib librar ies used by various programs and languages /tmp a "scratch" area where any user can store files temporarily /usr system files and directories that you share with other users /home/bioinf1 = home directory of user bioinf1 Moving around in the file system (Commands that you type are shown in the following with light gray background) pwd = present working directory move to a specific directory cd = change directory cd pathname for instance, cd /home/bionf1 cd.. go up one level in directory tree cd (without argument) go to your home directory What files do I have in my directory? ls ls -al (more extensive output) -rw-r--r-- 1 tore users :59 PF02854.txt -rw-r--r-- 1 tore users :54 PF02854_full.txt drwxr-xr-x 9 tore users :12 PhyloGrapher/ -rw-r--r-- 1 tore users :12 README.txt -rw-r--r-- 1 tore users :29 README_juan.txt -rw-r--r-- 1 tore users :05 RESULTS.txt -rwxr-xr-x 1 tores users :47 dnapars* lines starting with 'd' refer to directories file with 'x' is executable Manipulating Files and Directories cp source destination Moving and renaming files mv source destination

3 Creating and removing directories mkdir dirname rmdir dirname Removing files rm filename Viewing and editing files cat filename (will show the contents of filename on the screen) cat may also be used to merge files cat file1 file2 file3 > newfile (the symbol > means that we are now redirecting the output of the cat program to a file instead of the standard output which is the screen) or to append file(s) to an existing file cat file4 >> newfile Viewing a text file on the screen one page at a time more filename or even better less filename because less also allows you to move backwards in the file. Critical keys for less : space to move down enter to go one line at a time q to quit u to go up (back) Viewing or extracting the first and last lines of a file head filename head filename (first 1000 lines will be extracted) tail filename

4 Graphical editors Examples are nedit emacs Extracting file components with cut Let's consider the content of a file dat.txt where the columns are separated with a tab: We want to extract the columns 1 and 3: cut -f1,3 dat.txt produces: We may use any separator. Like if dat.txt has A;2;4500 B;5;4505 F;4;4510 cut -f1,2 -d ';' produces A;2 B;5 F;4 Sorting files with sort Consider the file dat2.txt with: A C B sort dat2.txt produces

5 A B C because file is sorted alphabetically But we may also sort numerically, and we may sort according to a specific column sort -n -k2 dat2.txt produces C A B where sorting was according to column 2 If we want to have ordering in the reverse direction: sort -n -k2 -r dat2.txt Unique lines uniq sortedfile produces the unique lines in a file (for this to work well the lines in the file need to be sorted) uniq -c sortedfile produces the same output but listing the number of times each line occurs. Comparing files with diff and comm diff sortedfile1 sortedfile2 will report differences between the two (sorted) files. comm -12 sortedfile1 sortedfile2 will show lines that are shared between the two files. Counting words with wc wc filename (counts lines, words and number of bytes) wc -l filename (counts lines only)

6 Redirection and pipes For the > and >> redirection symbols see above under "Viewing and editing files" The output of a file may be directed as input to another with a pipe ' ' symbol, like sort file uniq wc The output of sort will be sent to uniq and the output of uniq will be sent to wc. Result is the number of uniq lines in the file. Finding text strings with grep grep ">" sequence.fasta wc will produce all the lines with '>' in the file sequence.fasta the output will be directed to wc the final output is therefore the number of lines with '>' grep -n -v -i -l "AACGTA seqfile -n report line number -v report lines where AACGTA does not match -i ignore case, i.e for instance "aacgta may also match -l show only the file name, not the matching text Finding files with find To locate files with extension '.fa': find. -name "*.fa The dot right after the find command refers to the current directory, but by default find will also search all subdirectories in that directory. You may also want to locate files with a certain content. Here is what you could do: find. -exec grep HIV { \; This command will show all lines in all files that contain the string "HIV. The -exec parameter means that any program following 'exec' will be executed on the files found by find. You may instead want to list the files that contain the string "HIV": find. -exec grep -l HIV { \;

7 Useful features of unix shells when typing commands Command line completion with tab key Arrows to recall previous command Ctrl-E move to end of line Ctrl-A move to beginning of line Program run in the background Running a program "in the background" by putting the symbol & after the program command: program & Obtaining data from the net with wget wget is a useful unix utility to retrieve a specific URL. Here is how to retrieve from the NCBI FTP site Genbank records of Bacillus anthracis CDC 684. wget ftp://ftp.ncbi.nih.gov/genomes/bacteria/bacillus_anthracis_cdc_684/nc_ gbk In some cases data has been compressed and archived and may have the extension "tar.gz". Like this file containing a distribution of the linux blast program. wget ftp://ftp.ncbi.nih.gov/blast/executables/release/2.0.10/blast ia32-linux.tar.gz Then you need to uncompress gunzip blast ia32-linux.tar.gz The resulting file is blast ia32-linux.tar Then unpack the contents of the tar archive: tar -xvf blast ia32-linux.tar

8 A selection of bioinformatics software run in the unix environment 1. sixpack The EMBOSS program sixpack will produce translation products of an input DNA sequence. sixpack seqfile. The output will be two files, with extensions fasta and sixpack, respectively 2. clustalw ClustalW is a program for multiple sequence alignments. The input is typically a collection of sequences in a fasta format. clustalw sequencefile Two different output files are produced. One has the extension 'aln' and is the actual alignment. The other file with extension 'dnd' is a file with information on the tree that was used in the construction of the alignment. The tree may be viewed with programs such as njplot. 3. blastall BLAST is a frequently used program to search databases for sequence similarity to a query sequence. A typical command line for a BLAST search using the NCBI version is: blastall -i input -d database -o output_file -p type_of_blast_search -i input file in FASTA format -d database -o name of output file -p type of blast search, the most common options are: blastn - search a nucleotide database with a nt query blastp - search a protein database with a protein query tblastn - search a nucleotide database with a protein query blastx - search a protein database with a nucleotide query Other useful parameters are: -v Number of hits to show in summary table -b Number of hits to show as alignments -F F Select to have filtering turned off. By default low complexity sequences will be filtered out in the search.

9 4. blastpgp blastpgp is the name of the executable for psi-blast in the unix environment. blastpgp -i input -d database -j number where j is the parameter specifiying how many rounds (iterations) will be carried out.

10 VERY SHORT INTRODUCTION TO PERL First example program: #!/usr/bin/perl $seq = 'gcgagggtcacgagcgagtcggtgtcaagt'; $target = 'gtca'; for ($a=0; $a< length($seq); $a++) { $extract = substr($seq,$a,4); if ($extract eq $target) { print "Found match of $target at $a\n ; Executing perl programs perl program.pl or program.pl The second alternative assumes that there is a line : #!/usr/bin/perl at the head of the program file and that the file has been made executable. This is done with: chmod +x program.pl

11 Variables Scalars $dna = 'gctatatat'; $pi = 3.14; Extracting portion of a string: $part = substr($dna,2,3) # (take 3 characters starting from # position 2) print $part; (will print "tat ) = = (3,6,12,13,16); Hashes Elements in arrays are referred to with numbers 0,1,2 etc. print "Third element in array dna is $dna[2]; (will print "C ) %id2description = ( AC => "protein kinase BC => "dehydrogenase NX => "hexokinase ) Values to the left in the above hash are referred to as keys, values to the right values Obtain the value for the key AC print "$id2description{ac "; (protein kinase will be printed) Special variables $_ default variable in perl, a kind of shorthand examples: while (<IN>) {... is the same as while ($_ =<IN>) {... /^Subject:/ is the same as $_ =~ /^Subject:/ tr/a/a/ is the same as $_ =~ tr/a/a/ print is the same as print $_

12 Conditional statements if/else : if ($a < 10) {print "less than 10"; else {print "10 or larger"; Loops For ($a=0; $a < 4; $a++) { print "$a "; (will print " = (A,G,C,T); foreach $letter(@dna) { print "$letter "; (will print "A G C T ) Operators + - * / addition, subtraction, multiplication, division && logical operators OR, AND. concatenation of two strings ==!= numeric equality, inequality eq ne string equality, inequality < > Numeric less than, greater than <= >= Numeric less(greater) than or equal to Pattern matching $seq = 'GGACGGACTG'; if ($seq =~ /ACG/) {print "match"; # is there a match of ACG to the string in $str? =~ is the "binding operator / / is the regular expression delimiter Examples of regular expressions:

13 /A.G/) /^GG/ /G$/ /G{1,2/ /G+/ /G*/ /[^AGCT]/ (. is any character) (matches GG at beginning of string) (matches G at end of string) matches a series of Gs occuring in the range 1-2, i.e 'G' or 'GG' matches one or more of Gs matches zero, one or more of G matches any character which is not A G C or T Capturing matched patterns If you place parantheses around a pattern the matched string will be stored in memory. The contents may be recalled using $1. ($2 for a second set of parantheses etc) $seq = 'GGACGGACTG'; $seq =~ /(G.A)/ ; print "A match was found at $1"; Substitution and transliteration operators $dna = 'GCAATGG'; print "The DNA sequence is $dna\n"; $rna = $dna; $rna =~ s/t/u/g; print "and the RNA sequence is $rna\n"; s is the substitution operator g = global modifier, replace all Ts with Us Produce the reverse complement of a DNA sequence: $dna = 'GCAATGG'; $rev = reverse($dna); $rev =~ tr/atcg/tagc/; print "$rev\n";

14 Counting characters in a string $dna = 'GCAATGG'; $count_c = 0; $count_g = 0; $count_a = 0; $count_t = = split('',$dna); foreach $base(@dna) { if ($base eq 'a') {$count_a++; if ($base eq 't') {$count_t++; if ($base eq 'c') {$count_c++; if ($base eq 'g') {$count_g++; print "bases a, t, c,g are $count_a $count_t $count_c $count_g\n ; As an alternative method : for ($a=0; $a<length($dna); $a++) { $base = substr($dna,$a,1); if ($base eq 'a') {$count_a++; if ($base eq 't') {$count_t++; if ($base eq 'c') {$count_c++; if ($base eq 'g') {$count_g++; Executing a program from within a perl script $id = 'brca1_human'; system ("fastacmd -s $id -d /dbs/nr > protein.fa"); The fastacmd command will retrieve a sequence from the protein sequence database nr and the resulting sequence will be stored in the file 'protein.fa'

15 Reading from a file <FILEHANDLE> in scalar context reads a single line from the file opened by FILEHANDLE : #!/usr/bin/perl $seq = ''; open IN, 'seq.fa' ; while (<IN>) { # we are reading one line at a time unless (/>/) { # we will disregard all lines that contain '>' chomp; # remove the end of line character # add the line to the sequence already stored in $seq $seq = $seq. $_; close IN; In array context, reads the whole file: open IN, = <IN>; close IN; print "@dna"; Writing to a file open OUT, ">outputfile"; print OUT "GGCTACTGAC \n"; close OUT; Or the same thing could be accompished like this: If the script "line.pl" contains this single line: print "GGCTACTGAC"; the following command: perl line.pl > outputfile will now save the text "GGCTACTGAC" in a file called outputfile

16 Using arguments with a perl script It is often convenient to supply information to a perl script on the command line. Let's say we have a perl script "file.pl with the following content: open IN, $ARGV[0] or die "There is no file with that name\n"; print "This is the content of file $ARGV[0]:\n"; while (<IN>) { print; close IN; We assume here that some file is to read by the perl script, the name of that file is an argument on the command line, like: perl file.pl notes.txt The contains all the words listed on the command line after the name of the perl script. The variable $ARGV[0] has the first element of this array, i.e in this case "notes.txt.

17 Using perl in bioinformatics: Reformatting files with perl A common task in bioinformatics is to reformat data in a file. Consider for instance this example where the species name of the fasta line in a fasta-formatted Genbank record will end up as the identifier. #!/usr/bin/perl # try it with the input file brca1 $in = $ARGV[0]; $c = 0; open IN, $in; while (<IN>) { if (/>.*\[(.*)\]/) { # text within brackets [] is captured $org = $1; $c++; print ">$c"; print "_"; $org =~ s/ /_/g; print "$org\n"; else {print; close IN; A line >gi gb AAC BRCA1 [Rattus norvegicus] will change into >1_Rattus_norvegicus A number is added to the species name in order to avoid multiple identical identifiers.

18 Using perl in bioinformatics: Parsing the output of BLAST with a perl script #!/usr/bin/perl use Bio::SearchIO; $in = new Bio::SearchIO(-format => 'blast', -file => 'human.blastx'); while( $result = $in->next_result ) { ## $result is a Bio::Search::Result::ResultI compliant object while( $hit = $result->next_hit ) { ## $hit is a Bio::Search::Hit::HitI compliant object while( $hsp = $hit->next_hsp ) { ## $hsp is a Bio::Search::HSP::HSPI compliant object if( $hsp->length('total') > 30 ) { if ( $hsp->percent_identity >= 75 ) { print "Query=", $result->query_name, " Hit=", $hit->name, " Length=", $hsp->length('total'), " Percent_id=", $hsp->percent_identity, "\n"; A BLAST report is in the file 'human.blastx'. "Result" is the result of a blast search with a specific query sequence. "Hit" refers to a database sequence. "Hsp" refers as expected to an HSP (high scoring pair).

Introduction to UNIX command-line II

Introduction to UNIX command-line II Introduction to UNIX command-line II Boyce Thompson Institute 2017 Prashant Hosmani Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions Compression

More information

Using Linux as a Virtual Machine

Using Linux as a Virtual Machine Intro to UNIX Using Linux as a Virtual Machine We will use the VMware Player to run a Virtual Machine which is a way of having more than one Operating System (OS) running at once. Your Virtual OS (Linux)

More information

Introduction to UNIX command-line

Introduction to UNIX command-line Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions

More information

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

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the

More information

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

Unix Essentials. BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th Unix Essentials BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th 2016 http://barc.wi.mit.edu/hot_topics/ 1 Outline Unix overview Logging in to tak Directory structure

More information

Bioinformatics. Computational Methods I: Genomic Resources and Unix. George Bell WIBR Biocomputing Group

Bioinformatics. Computational Methods I: Genomic Resources and Unix. George Bell WIBR Biocomputing Group Bioinformatics Computational Methods I: Genomic Resources and Unix George Bell WIBR Biocomputing Group Human genome databases Human Genome Sequencing Consortium Major annotators: NCBI Ensembl (EMBL-EBI

More information

Where can UNIX be used? Getting to the terminal. Where are you? most important/useful commands & examples. Real Unix computers

Where can UNIX be used? Getting to the terminal. Where are you? most important/useful commands & examples. Real Unix computers Where can UNIX be used? Introduction to Unix: most important/useful commands & examples Bingbing Yuan Jan. 19, 2010 Real Unix computers tak, the Whitehead h Scientific Linux server Apply for an account

More information

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

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar. L555 Dept. of Linguistics, Indiana University Fall 2010 1 / 21 What is? is an operating system, like DOS or Windows developed in 1969 by Bell Labs works well for single computers as well as for servers

More information

Introduction to Linux. Roman Cheplyaka

Introduction to Linux. Roman Cheplyaka Introduction to Linux Roman Cheplyaka Generic commands, files, directories What am I running? ngsuser@ubuntu:~$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu

More information

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

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version... Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing

More information

Files

Files http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating

More information

Install and run external command line softwares. Yanbin Yin

Install and run external command line softwares. Yanbin Yin Install and run external command line softwares Yanbin Yin 1 Create a folder under your home called hw8 Change directory to hw8 Homework #8 Download Escherichia_coli_K_12_substr MG1655_uid57779 faa file

More information

Useful Unix Commands Cheat Sheet

Useful Unix Commands Cheat Sheet Useful Unix Commands Cheat Sheet The Chinese University of Hong Kong SIGSC Training (Fall 2016) FILE AND DIRECTORY pwd Return path to current directory. ls List directories and files here. ls dir List

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Introduction Into Linux Lecture 1 Johannes Werner WS 2017

Introduction Into Linux Lecture 1 Johannes Werner WS 2017 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)

More information

Unix, Perl and BioPerl. Why Unix (for me)? Objectives. Why Unix (in general)? Introduction to Unix. for Bioinformatics. Why Unix for Bioinformatics?

Unix, Perl and BioPerl. Why Unix (for me)? Objectives. Why Unix (in general)? Introduction to Unix. for Bioinformatics. Why Unix for Bioinformatics? Introduction to Unix for Bioinformatics Unix, Perl and BioPerl I: Introduction to Unix for Bioinformatics George Bell, Ph.D. WIBR Biocomputing Group Why Unix? The Unix operating system Files and directories

More information

Sequence Alignment: BLAST

Sequence Alignment: BLAST E S S E N T I A L S O F N E X T G E N E R A T I O N S E Q U E N C I N G W O R K S H O P 2015 U N I V E R S I T Y O F K E N T U C K Y A G T C Class 6 Sequence Alignment: BLAST Be able to install and use

More information

A Brief Introduction to the Linux Shell for Data Science

A Brief Introduction to the Linux Shell for Data Science A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like

More information

Unix, Perl and BioPerl

Unix, Perl and BioPerl Unix, Perl and BioPerl I: Introduction to Unix for Bioinformatics George Bell, Ph.D. WIBR Bioinformatics and Research Computing http://web.wi.mit.edu/bio Joe Sanjeev George Melissa Fran Kim Tom 2 Training

More information

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 Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction

More information

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 Cloud Computing and Unix: An Introduction Dr. Sophie Shaw University of Aberdeen, UK s.shaw@abdn.ac.uk Aberdeen London Exeter What We re Going To Do Why Unix? Cloud Computing Connecting to AWS Introduction

More information

Unix Tools / Command Line

Unix Tools / Command Line Unix Tools / Command Line An Intro 1 Basic Commands / Utilities I expect you already know most of these: ls list directories common options: -l, -F, -a mkdir, rmdir make or remove a directory mv move/rename

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

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

Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen 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

More information

A Brief Introduction to Unix

A Brief Introduction to Unix A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories

More information

Introduction. File System. Note. Achtung!

Introduction. File System. Note. Achtung! 3 Unix Shell 1: Introduction Lab Objective: Explore the basics of the Unix Shell. Understand how to navigate and manipulate file directories. Introduce the Vim text editor for easy writing and editing

More information

Unix, Perl and BioPerl

Unix, Perl and BioPerl Unix, Perl and BioPerl III: Sequence Analysis with Perl - Modules and BioPerl George Bell, Ph.D. WIBR Bioinformatics and Research Computing Sequence analysis with Perl Modules and BioPerl Regular expressions

More information

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

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011 Unix/Linux Operating System Introduction to Computational Statistics STAT 598G, Fall 2011 Sergey Kirshner Department of Statistics, Purdue University September 7, 2011 Sergey Kirshner (Purdue University)

More information

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

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal. Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If

More information

Unix basics exercise MBV-INFX410

Unix basics exercise MBV-INFX410 Unix basics exercise MBV-INFX410 In order to start this exercise, you need to be logged in on a UNIX computer with a terminal window open on your computer. It is best if you are logged in on freebee.abel.uio.no.

More information

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

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---

More information

genome[phd14]:/home/people/phd14/alignment >

genome[phd14]:/home/people/phd14/alignment > Unix Introduction to Unix Shell There is a special type of window called shell or terminalwindow. Terminal windows are the principal vehicle of interaction with a UNIX machine. Their function is to perform

More information

Arkansas High Performance Computing Center at the University of Arkansas

Arkansas High Performance Computing Center at the University of Arkansas Arkansas High Performance Computing Center at the University of Arkansas AHPCC Workshop Series Introduction to Linux for HPC Why Linux? Compatible with many architectures OS of choice for large scale computing

More information

Sequence analysis with Perl Modules and BioPerl. Unix, Perl and BioPerl. Regular expressions. Objectives. Some uses of regular expressions

Sequence analysis with Perl Modules and BioPerl. Unix, Perl and BioPerl. Regular expressions. Objectives. Some uses of regular expressions Unix, Perl and BioPerl III: Sequence Analysis with Perl - Modules and BioPerl George Bell, Ph.D. WIBR Bioinformatics and Research Computing Sequence analysis with Perl Modules and BioPerl Regular expressions

More information

BLAST. Jon-Michael Deldin. Dept. of Computer Science University of Montana Mon

BLAST. Jon-Michael Deldin. Dept. of Computer Science University of Montana Mon BLAST Jon-Michael Deldin Dept. of Computer Science University of Montana jon-michael.deldin@mso.umt.edu 2011-09-19 Mon Jon-Michael Deldin (UM) BLAST 2011-09-19 Mon 1 / 23 Outline 1 Goals 2 Setting up your

More information

Basic Linux (Bash) Commands

Basic Linux (Bash) Commands Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting

More information

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

Unix Basics. Benjamin S. Skrainka University College London. July 17, 2010 Unix Basics Benjamin S. Skrainka University College London July 17, 2010 Overview We cover basic Unix survival skills: Why you need some Unix in your life How to get some Unix in your life Basic commands

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists 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

More information

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

Introduction to Unix and Linux. Workshop 1: Directories and Files Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics

More information

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

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 Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing

More information

5/8/2012. Exploring Utilities Chapter 5

5/8/2012. Exploring Utilities Chapter 5 Exploring Utilities Chapter 5 Examining the contents of files. Working with the cut and paste feature. Formatting output with the column utility. Searching for lines containing a target string with grep.

More information

Recap From Last Time:

Recap From Last Time: Recap From Last Time: BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and

More information

BGGN 213 Working with UNIX Barry Grant

BGGN 213 Working with UNIX Barry Grant BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Recap From Last Time: Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Stephen Pauwels Computer Systems Academic Year 2018-2019 Overview of the Semester UNIX Introductie Regular Expressions Scripting Data Representation Integers, Fixed point,

More information

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

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt

More information

Bioinformatics for Biologists. Ensembl: NCBI. Ensembl ContigView. Mammalian genome databases

Bioinformatics for Biologists. Ensembl:  NCBI. Ensembl ContigView. Mammalian genome databases Mammalian genome databases Bioinformatics for Biologists Computational Methods I: Genomic Resources and Unix George Bell, Ph.D. WIBR Biocomputing Group Organizing, analyzing, integrating, and presenting

More information

CANB7640 Practical Workshop Class 01

CANB7640 Practical Workshop Class 01 CANB7640 Practical Workshop Class 01 Aik Choon Tan, Ph.D. Associate Professor of Bioinformatics Division of Medical Oncology Department of Medicine aikchoon.tan@ucdenver.edu 9/6/2016 http://tanlab.ucdenver.edu/labhomepage/teaching/canb7640/

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

Introduction to Linux

Introduction to Linux Introduction to Linux University of Bristol - Advance Computing Research Centre 1 / 47 Operating Systems Program running all the time Interfaces between other programs and hardware Provides abstractions

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Introduction to UNIX Stephen Pauwels University of Antwerp October 2, 2015 Outline What is Unix? Getting started Streams Exercises UNIX Operating system Servers, desktops,

More information

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

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

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

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80 CSE 303 Lecture 2 Introduction to bash shell read Linux Pocket Guide pp. 37-46, 58-59, 60, 65-70, 71-72, 77-80 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Unix file system structure

More information

CS4350 Unix Programming. Outline

CS4350 Unix Programming. Outline Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission

More information

Unix Workshop Aug 2014

Unix Workshop Aug 2014 Unix Workshop 2014 5 Aug 2014 What is Unix Multitasking, multiuser operating system Often the OS of choice for large servers, large clusters Unix Around You You re probably familiar with these: Linux Solaris

More information

The Unix Shell. Pipes and Filters

The Unix Shell. Pipes and Filters The Unix Shell Copyright Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information. shell shell pwd

More information

Week 2 Lecture 3. Unix

Week 2 Lecture 3. Unix Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell

More information

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs; Note: you can find this file under: http://www.cs.queensu.ca/ acmteam/unix.pdf Introduction to Unix Tutorial In this tutorial, you will learn: How to manage your account (user ID, password, shell); Navigating

More information

Introduction To Linux. Rob Thomas - ACRC

Introduction To Linux. Rob Thomas - ACRC Introduction To Linux Rob Thomas - ACRC What Is Linux A free Operating System based on UNIX (TM) An operating system originating at Bell Labs. circa 1969 in the USA More of this later... Why Linux? Free

More information

Mineração de Dados Aplicada

Mineração de Dados Aplicada Simple but Powerful Text-Processing Commands August, 29 th 2018 DCC ICEx UFMG Unix philosophy Unix philosophy Doug McIlroy (inventor of Unix pipes). In A Quarter-Century of Unix (1994): Write programs

More information

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix Filesystem. January 26 th, 2004 Class Meeting 2 Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface

More information

CS197U: A Hands on Introduction to Unix

CS197U: A Hands on Introduction to Unix CS197U: A Hands on Introduction to Unix Lecture 11: WWW and Wrap up Tian Guo University of Massachusetts Amherst CICS 1 Reminders Assignment 4 was graded and scores on Moodle Assignment 5 was due and you

More information

Advanced Linux Commands & Shell Scripting

Advanced Linux Commands & Shell Scripting Advanced Linux Commands & Shell Scripting Advanced Genomics & Bioinformatics Workshop James Oguya Nairobi, Kenya August, 2016 Man pages Most Linux commands are shipped with their reference manuals To view

More information

Programming Languages and Uses in Bioinformatics

Programming Languages and Uses in Bioinformatics Programming in Perl Programming Languages and Uses in Bioinformatics Perl, Python Pros: reformatting data files reading, writing and parsing files building web pages and database access building work flow

More information

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP

Unix Guide. Meher Krishna Patel. Created on : Octorber, 2017 Last updated : December, More documents are freely available at PythonDSP Unix Guide Meher Krishna Patel Created on : Octorber, 2017 Last updated : December, 2017 More documents are freely available at PythonDSP Table of contents Table of contents i 1 Unix commands 1 1.1 Unix

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

Research. We make it happen. Unix Basics. User Support Group help-line: personal:

Research. We make it happen. Unix Basics. User Support Group help-line: personal: Research. We make it happen. Unix Basics Presented by: Patton Fast User Support Group help-line: help@msi.umn.edu 612-626-0802 personal: pfast@msi.umn.edu 612-625-6573 Outline I. Warnings! II. III. IV.

More information

Linux Bash Shell Scripting

Linux Bash Shell Scripting University of Chicago Initiative in Biomedical Informatics Computation Institute Linux Bash Shell Scripting Present by: Mohammad Reza Gerami gerami@ipm.ir Day 2 Outline Support Review of Day 1 exercise

More information

Reading and manipulating files

Reading and manipulating files Reading and manipulating files Goals By the end of this lesson you will be able to Read files without using text editors Access specific parts of files Count the number of words and lines in a file Sort

More information

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

LING 408/508: Computational Techniques for Linguists. Lecture 5 LING 408/508: Computational Techniques for Linguists Lecture 5 Last Time Installing Ubuntu 18.04 LTS on top of VirtualBox Your Homework 2: did everyone succeed? Ubuntu VirtualBox Host OS: MacOS or Windows

More information

Introduction to the Linux Command Line

Introduction to the Linux Command Line Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected

More information

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CENG 334 Computer Networks. Laboratory I Linux Tutorial CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction

More information

INTRODUCTION TO BIOINFORMATICS

INTRODUCTION TO BIOINFORMATICS Introducing the LINUX Operating System BecA-ILRI INTRODUCTION TO BIOINFORMATICS Mark Wamalwa BecA- ILRI Hub, Nairobi, Kenya h"p://hub.africabiosciences.org/ h"p://www.ilri.org/ m.wamalwa@cgiar.org 1 What

More information

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

Introduction to remote command line Linux. Research Computing Team University of Birmingham Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments

More information

Introduction to Linux Basics

Introduction to Linux Basics Introduction to Linux Basics Part-I Georgia Advanced Computing Resource Center University of Georgia Zhuofei Hou, HPC Trainer zhuofei@uga.edu Outline What is GACRC? What is Linux? Linux Command, Shell

More information

The Linux Command Line & Shell Scripting

The Linux Command Line & Shell Scripting The Linux Command Line & Shell Scripting [web] [email] portal.biohpc.swmed.edu biohpc-help@utsouthwestern.edu 1 Updated for 2017-11-18 Study Resources : A Free Book 500+ pages * Some of the materials covered

More information

Linux command line basics II: downloading data and controlling files. Yanbin Yin

Linux command line basics II: downloading data and controlling files. Yanbin Yin Linux command line basics II: downloading data and controlling files Yanbin Yin 1 Things you should know about programming Learning programming has to go through the hands-on practice, a lot of practice

More information

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r 1. Which symbol will be used with grep command to match the pattern pat at the beginning of a line? A) ^pat B) $pat C) pat$ D) pat^ 2. Which command is used to sort the lines of data in a file in reverse

More information

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

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

Files and Directories

Files and Directories CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on

More information

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface

FREEENGINEER.ORG. 1 of 6 11/5/15 8:31 PM. Learn UNIX in 10 minutes. Version 1.3. Preface FREEENGINEER.ORG Learn UNIX in 10 minutes. Version 1.3 Preface This is something that I had given out to students (CAD user training) in years past. The purpose was to have on one page the basics commands

More information

Introduction to Linux

Introduction to Linux Introduction to Linux M Tech CS I 2015-16 Arijit Bishnu Debapriyo Majumdar Sourav Sengupta Mandar Mitra Login, Logout, Change password $ ssh, ssh X secure shell $ ssh www.isical.ac.in $ ssh 192.168 $ logout,

More information

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

Basic Linux Commands. Srihari Kalgi M.Tech, CSE (KReSIT), IIT Bombay. May 5, 2009 Basic Linux Commands Srihari Kalgi M.Tech, CSE (KReSIT), IIT Bombay May 5, 2009 General Purpose utilities Linux File System File Handling Commands Compressing and Archiving Files Simple Filters General

More information

Outline. Structure of a UNIX command

Outline. Structure of a UNIX command Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory

More information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

CS197U: A Hands on Introduction to Unix

CS197U: A Hands on Introduction to Unix CS197U: A Hands on Introduction to Unix Lecture 3: UNIX Operating System Organization Tian Guo CICS, Umass Amherst 1 Reminders Assignment 2 is due THURSDAY 09/24 at 3:45 pm Directions are on the website

More information

Shell Programming Overview

Shell Programming Overview Overview Shell programming is a way of taking several command line instructions that you would use in a Unix command prompt and incorporating them into one program. There are many versions of Unix. Some

More information

CS CS Tutorial 2 2 Winter 2018

CS CS Tutorial 2 2 Winter 2018 CS CS 230 - Tutorial 2 2 Winter 2018 Sections 1. Unix Basics and connecting to CS environment 2. MIPS Introduction & CS230 Interface 3. Connecting Remotely If you haven t set up a CS environment password,

More information

SRM UNIVERSITY DEPARTMENT OF BIOINFORMATICS

SRM UNIVERSITY DEPARTMENT OF BIOINFORMATICS LIST OF EXPERIMENTS 1. Basic UNIX Commands 2. Working with vi editor 3. Working with emacs editors 4. Advanced UNIX Utilities 5. Creating a Bioinformatics directory 6. Simple Perl Program (Operators) 7.

More information

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

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection 1 CSE 390a Lecture 2 Exploring Shell Commands, Streams, and Redirection slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/390a/ 2 Lecture summary Unix

More information

Oxford University Computing Services. Getting Started with Unix

Oxford University Computing Services. Getting Started with Unix Oxford University Computing Services Getting Started with Unix Unix c3.1/2 Typographical Conventions Listed below are the typographical conventions used in this guide. Names of keys on the keyboard are

More information

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

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information

Introduction to Linux Organizing Files

Introduction to Linux Organizing Files Introduction to Linux Organizing Files Computational Science and Engineering North Carolina A&T State University Instructor: Dr. K. M. Flurchick Email: kmflurch@ncat.edu Arranging, Organizing, Packing

More information

Introduction to UNIX Command Line

Introduction to UNIX Command Line Introduction to UNIX Command Line Files and directories Some useful commands (echo, cat, grep, find, diff, tar) Redirection Pipes Variables Background processes Remote connections (e.g. ssh, curl) Scripts

More information

Introduction to Linux Environment. Yun-Wen Chen

Introduction to Linux Environment. Yun-Wen Chen Introduction to Linux Environment Yun-Wen Chen 1 The Text (Command) Mode in Linux Environment 2 The Main Operating Systems We May Meet 1. Windows 2. Mac 3. Linux (Unix) 3 Windows Command Mode and DOS Type

More information

Practical Session 0 Introduction to Linux

Practical Session 0 Introduction to Linux School of Computer Science and Software Engineering Clayton Campus, Monash University CSE2303 and CSE2304 Semester I, 2001 Practical Session 0 Introduction to Linux Novell accounts. Every Monash student

More information

Scripting Languages Course 1. Diana Trandabăț

Scripting Languages Course 1. Diana Trandabăț Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language

More information