SlideShare a Scribd company logo
Sol Genomics Network
Introduction to
UNIX command-line
Boyce Thompson Institute
March 17, 2015
Lukas Mueller & Noe Fernandez
Sol Genomics Network
• Terminal file system navigation
• Wildcards, shortcuts and special characters
• File permissions
• Compression UNIX commands
• Networking UNIX commands
• Basic NGS file formats
• Text files manipulation commands
• Command-line pipelines
• Introduction to bash scripts
Class Content
Sol Genomics Network
What is a virtual machine?
Sol Genomics Network
What is a terminal?
Sol Genomics Network
Origins of Linux.The UNIX operating system
Sol Genomics Network
Why use command-line?
• Most software for biological data analysis is used through
UNIX command-line terminal
• Most of the servers for biological data analysis use Linux as
operative system
• Data analysis on calculation servers are much faster since we
can use more CPUs and RAM than in a PC (e.g.: Boyce servers
has 64 cores and 1TB RAM)
• Large NGS data files can not be opened or loaded in most of
GUI-based software and web sites
• Compression commands are useful, since NGS large data files
usually are stored and shared as compressed files
Sol Genomics Network
Text handling commandsText handling commands
command > file saves STDOUT in a file
command >> file appends STDOUT in a file
cat file concatenate and print files
cat file1 file2 > file3 merges files 1 and 2 into file3
cat *fasta > all.fasta
concatenates all fasta files in
the current directory
head file prints first lines from a file
head -n 5 file prints first five lines from a file
tail file prints last lines from a file
tail -n 5 file prints last five lines from a file
less file view a file
less -N file includes line numbers
less -S file wraps long lines
grep ‘pattern’ file Prints lines matching a pattern
grep -c ‘pattern’ file counts lines matching a pattern
cut -f 1,3 file
retrieves data from selected
columns in a tab-delimited file
sort file sorts lines from a file
sort -u file sorts and return unique lines
uniq -c file filters adjacent repeated lines
wc file counts lines, words and bytes
paste file1 file2
concatenates the lines of input
files
paste -d “,”
concatenates the lines of input
files by commas
sed transforms text
File system CommandsFile system Commands
ls lists directories and files
ls -a lists all files including hidden files
ls -lh formatted list including more data
ls -t lists sorted by date
pwd returns path to working directory
cd dir changes directory
cd .. goes to parent directory
cd / goes to root directory
cd goes to home directory
touch file_name creates en empty file
cp file file_copy copy a file
cp -r copy files contained in directories
rm file deletes a file
rm -r dir deletes a directory and its files
mv file1 file2 moves or renames a file
mkdir dir_name creates a directory
rmdir dir_name deletes a directory
locate file_name searches a file
man command shows commands manual
top shows process activity
df -h shows disk space info
Networking CommandsNetworking Commands
wget URL download a file from an URL
ssh user@server connects to a server
scp copy files between computers
apt-get install installs applications in linux
Compression commandsCompression commands
gzip/zip compress a file
gunzip/unzip decompress a file
tar -cvf groups files
tar -xvf ungroups files
tar -zcvf groups and gzip files
tar -zxvf gunzip and ungroups files
UNIX Command-Line Cheat Sheet
BTI-SGN Bioinformatics Course 2014
•File system commands
File system navigation
http://www.slideshare.net/NoFernndezPozo/unix-command-sheet2014
https://btiplantbioinfocourse.files.wordpress.com/2014/02/unix_command_sheet_2014.pdf
Download the cheat sheet from:
Sol Genomics Network
File system navigation
File Browser Terminal
=
Sol Genomics Network
Home and Root directories
/bin, /lib, /usr code and code libraries
/var logs and other data
/home user directories
/tmp temporary files
/etc configuration information
/proc special file system in Linux
/home/bioinfo
/home/noe
/home/noe/Desktop
Root directory
Home directory
Sol Genomics Network
Anatomy of a UNIX command
grep -c -A 3 --ignore-case file.txt
command
Simple option flag
(short form)
option (long form)option with
argument
argument
man grep
print grep manual
Sol Genomics Network
ls, cd and pwd to navigate the file system
• where am I? pwd
• how to change current directory cd
• what files and directories are in my current directory? ls
pwd
return current work directory
Sol Genomics Network
ls
list directories and files in current directory
ls lists directories and files
ls -a
list all directories and files, including hidden files
ls -l -h -t
time sorted
ls -lhS
size sorted
ls -l -h
list in long format
human readable
Sol Genomics Network
ls lists directories and files
r readable
w writable
x executable or searchable
- not rwx
d Directory
- Regular file
d rwx r-x r-x
user
group
other
owner user
permissions
owner group
date File namesizelinks #
Sol Genomics Network
Use up and down
arrows to navigate
the command
history
Wildcards, history and some shortcuts
ls *txt
ls P*s list files starting with P and ending with s,
e.g.: Pictures, Photos, Programs ...
list all txt files in current directory
ctrl-c stop process
ctrl-a go to begin of line
ctrl-e go to end of line
ctrl-r search in command history
Sol Genomics Network
Escaping special characters
Tip: file names in lower
case and with underscores
instead of spaces
! @ $ ^ & * ~ ? . | / [ ] < >  ` " ;# ( )
Use tab key to
autocomplete names
ls my folder list a folder containing a space
ls my_folder list a folder
Sol Genomics Network
Use tab key to
autocomplete names
cd changes directory
cd Desktop
changes directory to Desktop
cd ..
goes to parent directory
cd goes to home directory
cd / goes to root directory
cd - goes to previous directory
Sol Genomics Network
Absolute and relative paths
ls /home/user/Desktop
list files in Desktop using an absolute path
ls Desktop/
list files in Documents using a relative path (from your home: /home/bioinfo)
ls ~/Desktop
list files in Desktop using your home as a reference
Sol Genomics Network
Absolute and relative paths
ls /home/bioinfo/Desktop
ls ~/Desktop
Absolute paths do not depend on where you are
~/ is equivalent to /home/bioinfo/
Sol Genomics Network
Absolute and relative paths
ls ../Documents
cd Desktop/
goes to Desktop from when you are in your home (/home/bioinfo)
list files from Documents when you are in Desktop
Sol Genomics Network
Create, copy, move and delete files
touch tmp_file.txt
creates an empty file called tmp_file.txt
cp tmp_file.txt file_copy.txt
copies tmp_file.txt in file_copy.txt
rm file.txt deletes file.txt
mv file1.txt file2.txt moves or rename a file
Tip: file names in lower
case and with underscores
instead of spaces
Sol Genomics Network
Locate a file
locate unix_class_file_samples.zip
Locate the path for the file unix_class_file_samples.zip
locate unix_class
Locate the path for all the files containing unix_class
Sol Genomics Network
Create, copy and delete directories
mkdir dir_name
creates an empty directory called dir_name
rmdir dir_name
deletes dir_name directory if it is empty
cp -r dir_name dir_copy
copy dir_name and its files in a new folder
rm -r dir_name delete dir_name and its files
Sol Genomics Network
wc file counts lines, words and bytes
paste file1 file2
concatenates the lines of input
files
paste -d “,”
concatenates the lines of input
files by commas
sed transforms text
locate file_name searches a file
man command shows commands manual
top shows process activity
df -h shows disk space info
Networking CommandsNetworking Commands
wget URL download a file from an URL
ssh user@server connects to a server
scp copy files between computers
apt-get install installs applications in linux
Compression commandsCompression commands
gzip/zip compress a file
gunzip/unzip decompress a file
tar -cvf groups files
tar -xvf ungroups files
tar -zcvf groups and gzip files
tar -zxvf gunzip and ungroups files
Text handling commandsText handling commands
command > file saves STDOUT in a file
command >> file appends STDOUT in a file
cat file concatenate and print files
cat file1 file2 > file3 merges files 1 and 2 into file3
cat *fasta > all.fasta
concatenates all fasta files in
the current directory
head file prints first lines from a file
head -n 5 file prints first five lines from a file
tail file prints last lines from a file
tail -n 5 file prints last five lines from a file
less file view a file
less -N file includes line numbers
less -S file wraps long lines
grep ‘pattern’ file Prints lines matching a pattern
grep -c ‘pattern’ file counts lines matching a pattern
cut -f 1,3 file
retrieves data from selected
columns in a tab-delimited file
sort file sorts lines from a file
sort -u file sorts and return unique lines
uniq -c file filters adjacent repeated lines
wc file counts lines, words and bytes
paste file1 file2
concatenates the lines of input
files
paste -d “,”
concatenates the lines of input
files by commas
sed transforms text
File system CommandsFile system Commands
ls lists directories and files
ls -a lists all files including hidden files
ls -lh formatted list including more data
ls -t lists sorted by date
pwd returns path to working directory
cd dir changes directory
cd .. goes to parent directory
cd / goes to root directory
cd goes to home directory
touch file_name creates en empty file
cp file file_copy copy a file
cp -r copy files contained in directories
rm file deletes a file
rm -r dir deletes a directory and its files
mv file1 file2 moves or renames a file
mkdir dir_name creates a directory
rmdir dir_name deletes a directory
locate file_name searches a file
man command shows commands manual
top shows process activity
df -h shows disk space info
Networking CommandsNetworking Commands
wget URL download a file from an URL
ssh user@server connects to a server
scp copy files between computers
apt-get install installs applications in linux
Compression commandsCompression commands
gzip/zip compress a file
gunzip/unzip decompress a file
tar -cvf groups files
tar -xvf ungroups files
tar -zcvf groups and gzip files
tar -zxvf gunzip and ungroups files
UNIX Command-Line Cheat Sheet
BTI-SGN Bioinformatics Course 2014
Compression commands
tar -zcvf file.tar.gz f1 f2
groups and compress files
tar -zxvf file.tar.gz
decompress and ungroup a tar.gz file files, directories or wildcards
Sol Genomics Network
Compression commands
gzip f1.txt
gunzip file.gz
unzip file.zip decompress file.zip
zip file.zip f1 f2
compress files f1 and f2 in file.zip
compress file f1.txt in f1.txt.gz
decompress file.gz
Sol Genomics Network
Text handling commandsText handling commands
command > file saves STDOUT in a file
command >> file appends STDOUT in a file
cat file concatenate and print files
cat file1 file2 > file3 merges files 1 and 2 into file3
cat *fasta > all.fasta
concatenates all fasta files in
the current directory
head file prints first lines from a file
head -n 5 file prints first five lines from a file
tail file prints last lines from a file
tail -n 5 file prints last five lines from a file
less file view a file
less -N file includes line numbers
less -S file wraps long lines
grep ‘pattern’ file Prints lines matching a pattern
grep -c ‘pattern’ file counts lines matching a pattern
cut -f 1,3 file
retrieves data from selected
columns in a tab-delimited file
sort file sorts lines from a file
sort -u file sorts and return unique lines
uniq -c file filters adjacent repeated lines
wc file counts lines, words and bytes
paste file1 file2
concatenates the lines of input
files
paste -d “,”
concatenates the lines of input
files by commas
sed transforms text
File system CommandsFile system Commands
ls lists directories and files
ls -a lists all files including hidden files
ls -lh formatted list including more data
ls -t lists sorted by date
pwd returns path to working directory
cd dir changes directory
cd .. goes to parent directory
cd / goes to root directory
cd goes to home directory
touch file_name creates en empty file
cp file file_copy copy a file
cp -r copy files contained in directories
rm file deletes a file
rm -r dir deletes a directory and its files
mv file1 file2 moves or renames a file
mkdir dir_name creates a directory
rmdir dir_name deletes a directory
locate file_name searches a file
man command shows commands manual
top shows process activity
df -h shows disk space info
Networking CommandsNetworking Commands
wget URL download a file from an URL
ssh user@server connects to a server
scp copy files between computers
apt-get install installs applications in linux
Compression commandsCompression commands
gzip/zip compress a file
gunzip/unzip decompress a file
tar -cvf groups files
tar -xvf ungroups files
tar -zcvf groups and gzip files
tar -zxvf gunzip and ungroups files
UNIX Command-Line Cheat Sheet
BTI-SGN Bioinformatics Course 2014
•Networking commands
Networking Commands
Sol Genomics Network
scp noe@boyce.sgn.cornell.edu:/home/noe/file.txt .
copy file.txt from your home in the server to the current directory in your computer
Networking Commands
wget http://btiplantbioinfocourse.files.wordpress.com/2014/01/unix_command_sheet_2014.pdf
downloads the UNIX command line cheat sheet PDF file
ssh user_name@server_adress
connects your terminal to your account in a server
Tip: use the command pwd to get the path for cp and scp
Sol Genomics Network
scp file.txt noe@boyce.sgn.cornell.edu:
copy file.txt from the current directory in my computer to my home in the server
Networking Commands
ssh noe@boyce.sgn.cornell.edu
connects my terminal to my account Boyce, the BTI server
scp -r dir/ noe@boyce.sgn.cornell.edu:
copy the folder dir and all its files and subdirectories to my home in the server
Sol Genomics Network
Useful commands in the server
top
display and update sorted information about processes
df -h shows disk space information
Sol Genomics Network
q quit
u user (top -u user)
M sort by memory usage
Top displays and update sorted information about processes
Sol Genomics Network
Commands to install software
sudo apt-get install pbzip2
installs pbzip2 in your computer
call the command with super user permissions
aptitude search blast
sudo aptitude install blast2
Sol Genomics Network
1. Go to your Desktop directory using the command cd
2. Use the command touch to create a file called:
Do not Use “special characters” in file names!.txt
3. Use the command rm to delete that file
4. Use the command mkdir to create a folder called unix_data in your desktop
5. Copy the file unix_class_file_samples.zip from your folder Data, in your home, to the
folder unix_data, in your desktop
6. Uncompress the file unix_class_file_samples.zip in /home/bioinfo/Desktop/unix_data
7. Use the command rm with the option -r to remove the _MACOSX folder
8. Use the command wget to download the “UNIX command line cheat sheet” PDF from:
https://btiplantbioinfocourse.files.wordpress.com/2014/02/unix_command_sheet_2014.pdf
Exercises

More Related Content

What's hot

Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Shakeel Shafiq
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
SuKyeong Jang
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
Mohan Krishna Kona
 
Linux final exam
Linux final examLinux final exam
Linux final exam
Andrew Ibrahim
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
Meerut Institute of Technology
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
meashi
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
Mohit Belwal
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
nitin lakhanpal
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
MohanKumar Palanichamy
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
Saikumar Daram
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
Soumya Behera
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
Acácio Oliveira
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
Shaun Morrow
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
Harikrishnan Ramakrishnan
 
Linux commands
Linux commandsLinux commands
Linux commands
Radheshyam Kori
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
thakor bharati
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
Acácio Oliveira
 
Linux commands
Linux commandsLinux commands
Linux commands
Manish Bothra
 
One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manual
dummy
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
Acácio Oliveira
 

What's hot (20)

Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Linux final exam
Linux final examLinux final exam
Linux final exam
 
Operating system lab manual
Operating system lab manualOperating system lab manual
Operating system lab manual
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
 
101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects101 3.4 use streams, pipes and redirects
101 3.4 use streams, pipes and redirects
 
Piping into-php
Piping into-phpPiping into-php
Piping into-php
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic unix commands_1
Basic unix commands_1Basic unix commands_1
Basic unix commands_1
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Linux commands
Linux commandsLinux commands
Linux commands
 
One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manual
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 

Similar to SGN Introduction to UNIX Command-line 2015 part 1

Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014
Noé Fernández-Pozo
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
Gourav Varma
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Linux ppt
Linux pptLinux ppt
Linux ppt
Sanmuga Nathan
 
Lecture1 2 intro-unix
Lecture1 2 intro-unixLecture1 2 intro-unix
Lecture1 2 intro-unix
nghoanganh
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
Ranjan Raja
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
PrashantTechment
 
Linux
LinuxLinux
Comenzi unix
Comenzi unixComenzi unix
Comenzi unix
Valentin Valentin
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
UtpalenduChakrobortt1
 
Quick guide of the most common linux commands
Quick guide of the most common linux commandsQuick guide of the most common linux commands
Quick guide of the most common linux commands
Carlos Enrique
 
Group13
Group13Group13
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
Priyadarshini648418
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
Linux commands
Linux commandsLinux commands
Linux commands
penetration Tester
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
OmprakashNath2
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
roschahacker
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
Sreenatha Reddy K R
 

Similar to SGN Introduction to UNIX Command-line 2015 part 1 (20)

Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014
 
Introduction to linux2
Introduction to linux2Introduction to linux2
Introduction to linux2
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Lecture1 2 intro-unix
Lecture1 2 intro-unixLecture1 2 intro-unix
Lecture1 2 intro-unix
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Linux
LinuxLinux
Linux
 
Comenzi unix
Comenzi unixComenzi unix
Comenzi unix
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Quick guide of the most common linux commands
Quick guide of the most common linux commandsQuick guide of the most common linux commands
Quick guide of the most common linux commands
 
Group13
Group13Group13
Group13
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 

More from solgenomics

Sl4.0 and ITAG4.0
Sl4.0 and ITAG4.0Sl4.0 and ITAG4.0
Sl4.0 and ITAG4.0
solgenomics
 
Cassavabase-PhenoApps demo ISTRC 2018
Cassavabase-PhenoApps demo ISTRC 2018Cassavabase-PhenoApps demo ISTRC 2018
Cassavabase-PhenoApps demo ISTRC 2018
solgenomics
 
Cassavabase-PhenoApp sample tracking
Cassavabase-PhenoApp sample trackingCassavabase-PhenoApp sample tracking
Cassavabase-PhenoApp sample tracking
solgenomics
 
breeding informatics solutions at SGN
breeding informatics solutions at SGNbreeding informatics solutions at SGN
breeding informatics solutions at SGN
solgenomics
 
Musabase PAG 2018
Musabase PAG 2018Musabase PAG 2018
Musabase PAG 2018
solgenomics
 
Cassavabase workshop ibadan March17
Cassavabase workshop ibadan March17Cassavabase workshop ibadan March17
Cassavabase workshop ibadan March17
solgenomics
 
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
solgenomics
 
SolGS Hyderabad conference 2016
SolGS Hyderabad conference 2016SolGS Hyderabad conference 2016
SolGS Hyderabad conference 2016
solgenomics
 
Musa base phenotyping workflow demo
Musa base phenotyping workflow demoMusa base phenotyping workflow demo
Musa base phenotyping workflow demo
solgenomics
 
SolGS workshop 2016
SolGS workshop 2016SolGS workshop 2016
SolGS workshop 2016
solgenomics
 
Cassavabase workshop IITA oct2016
Cassavabase workshop IITA oct2016Cassavabase workshop IITA oct2016
Cassavabase workshop IITA oct2016
solgenomics
 
Sql cheat sheet
Sql cheat sheetSql cheat sheet
Sql cheat sheet
solgenomics
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
solgenomics
 
YamBase phenotyping workflow demo
YamBase phenotyping workflow demoYamBase phenotyping workflow demo
YamBase phenotyping workflow demo
solgenomics
 
Introduction to YamBase
Introduction to YamBaseIntroduction to YamBase
Introduction to YamBase
solgenomics
 
Cassavabase general presentation PAG 2016
Cassavabase general presentation PAG 2016Cassavabase general presentation PAG 2016
Cassavabase general presentation PAG 2016
solgenomics
 
Cassavabase SolGS presentation PAG 2016
Cassavabase SolGS presentation PAG 2016Cassavabase SolGS presentation PAG 2016
Cassavabase SolGS presentation PAG 2016
solgenomics
 
Cassavabase SolGS poster PAG 2016
Cassavabase SolGS poster PAG 2016Cassavabase SolGS poster PAG 2016
Cassavabase SolGS poster PAG 2016
solgenomics
 
1 introduction to cassavabase
1  introduction to cassavabase 1  introduction to cassavabase
1 introduction to cassavabase
solgenomics
 
2 Cassavabase workshop: search menu
2  Cassavabase workshop: search menu2  Cassavabase workshop: search menu
2 Cassavabase workshop: search menu
solgenomics
 

More from solgenomics (20)

Sl4.0 and ITAG4.0
Sl4.0 and ITAG4.0Sl4.0 and ITAG4.0
Sl4.0 and ITAG4.0
 
Cassavabase-PhenoApps demo ISTRC 2018
Cassavabase-PhenoApps demo ISTRC 2018Cassavabase-PhenoApps demo ISTRC 2018
Cassavabase-PhenoApps demo ISTRC 2018
 
Cassavabase-PhenoApp sample tracking
Cassavabase-PhenoApp sample trackingCassavabase-PhenoApp sample tracking
Cassavabase-PhenoApp sample tracking
 
breeding informatics solutions at SGN
breeding informatics solutions at SGNbreeding informatics solutions at SGN
breeding informatics solutions at SGN
 
Musabase PAG 2018
Musabase PAG 2018Musabase PAG 2018
Musabase PAG 2018
 
Cassavabase workshop ibadan March17
Cassavabase workshop ibadan March17Cassavabase workshop ibadan March17
Cassavabase workshop ibadan March17
 
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
Improvements in the Tomato Reference Genome (SL3.0) and Annotation (ITAG3.0)
 
SolGS Hyderabad conference 2016
SolGS Hyderabad conference 2016SolGS Hyderabad conference 2016
SolGS Hyderabad conference 2016
 
Musa base phenotyping workflow demo
Musa base phenotyping workflow demoMusa base phenotyping workflow demo
Musa base phenotyping workflow demo
 
SolGS workshop 2016
SolGS workshop 2016SolGS workshop 2016
SolGS workshop 2016
 
Cassavabase workshop IITA oct2016
Cassavabase workshop IITA oct2016Cassavabase workshop IITA oct2016
Cassavabase workshop IITA oct2016
 
Sql cheat sheet
Sql cheat sheetSql cheat sheet
Sql cheat sheet
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
YamBase phenotyping workflow demo
YamBase phenotyping workflow demoYamBase phenotyping workflow demo
YamBase phenotyping workflow demo
 
Introduction to YamBase
Introduction to YamBaseIntroduction to YamBase
Introduction to YamBase
 
Cassavabase general presentation PAG 2016
Cassavabase general presentation PAG 2016Cassavabase general presentation PAG 2016
Cassavabase general presentation PAG 2016
 
Cassavabase SolGS presentation PAG 2016
Cassavabase SolGS presentation PAG 2016Cassavabase SolGS presentation PAG 2016
Cassavabase SolGS presentation PAG 2016
 
Cassavabase SolGS poster PAG 2016
Cassavabase SolGS poster PAG 2016Cassavabase SolGS poster PAG 2016
Cassavabase SolGS poster PAG 2016
 
1 introduction to cassavabase
1  introduction to cassavabase 1  introduction to cassavabase
1 introduction to cassavabase
 
2 Cassavabase workshop: search menu
2  Cassavabase workshop: search menu2  Cassavabase workshop: search menu
2 Cassavabase workshop: search menu
 

Recently uploaded

Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 
Farming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptxFarming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptx
Frédéric Baudron
 
Tissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptxTissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptx
muralinath2
 
The cost of acquiring information by natural selection
The cost of acquiring information by natural selectionThe cost of acquiring information by natural selection
The cost of acquiring information by natural selection
Carl Bergstrom
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
PirithiRaju
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
hozt8xgk
 
23PH301 - Optics - Optical Lenses.pptx
23PH301 - Optics  -  Optical Lenses.pptx23PH301 - Optics  -  Optical Lenses.pptx
23PH301 - Optics - Optical Lenses.pptx
RDhivya6
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
International Food Policy Research Institute- South Asia Office
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
Sciences of Europe
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
Scintica Instrumentation
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
Sérgio Sacani
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
PirithiRaju
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
University of Hertfordshire
 
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
Sérgio Sacani
 
Anti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark UniverseAnti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark Universe
Sérgio Sacani
 
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
eitps1506
 
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
ABHISHEK SONI NIMT INSTITUTE OF MEDICAL AND PARAMEDCIAL SCIENCES , GOVT PG COLLEGE NOIDA
 
HUMAN EYE By-R.M Class 10 phy best digital notes.pdf
HUMAN EYE By-R.M Class 10 phy best digital notes.pdfHUMAN EYE By-R.M Class 10 phy best digital notes.pdf
HUMAN EYE By-R.M Class 10 phy best digital notes.pdf
Ritik83251
 
LEARNING TO LIVE WITH LAWS OF MOTION .pptx
LEARNING TO LIVE WITH LAWS OF MOTION .pptxLEARNING TO LIVE WITH LAWS OF MOTION .pptx
LEARNING TO LIVE WITH LAWS OF MOTION .pptx
yourprojectpartner05
 

Recently uploaded (20)

Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 
Farming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptxFarming systems analysis: what have we learnt?.pptx
Farming systems analysis: what have we learnt?.pptx
 
Tissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptxTissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptx
 
The cost of acquiring information by natural selection
The cost of acquiring information by natural selectionThe cost of acquiring information by natural selection
The cost of acquiring information by natural selection
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
 
23PH301 - Optics - Optical Lenses.pptx
23PH301 - Optics  -  Optical Lenses.pptx23PH301 - Optics  -  Optical Lenses.pptx
23PH301 - Optics - Optical Lenses.pptx
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
 
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
Candidate young stellar objects in the S-cluster: Kinematic analysis of a sub...
 
Anti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark UniverseAnti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark Universe
 
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
 
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
MICROBIAL INTERACTION PPT/ MICROBIAL INTERACTION AND THEIR TYPES // PLANT MIC...
 
HUMAN EYE By-R.M Class 10 phy best digital notes.pdf
HUMAN EYE By-R.M Class 10 phy best digital notes.pdfHUMAN EYE By-R.M Class 10 phy best digital notes.pdf
HUMAN EYE By-R.M Class 10 phy best digital notes.pdf
 
LEARNING TO LIVE WITH LAWS OF MOTION .pptx
LEARNING TO LIVE WITH LAWS OF MOTION .pptxLEARNING TO LIVE WITH LAWS OF MOTION .pptx
LEARNING TO LIVE WITH LAWS OF MOTION .pptx
 

SGN Introduction to UNIX Command-line 2015 part 1

  • 1. Sol Genomics Network Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez
  • 2. Sol Genomics Network • Terminal file system navigation • Wildcards, shortcuts and special characters • File permissions • Compression UNIX commands • Networking UNIX commands • Basic NGS file formats • Text files manipulation commands • Command-line pipelines • Introduction to bash scripts Class Content
  • 3. Sol Genomics Network What is a virtual machine?
  • 4. Sol Genomics Network What is a terminal?
  • 5. Sol Genomics Network Origins of Linux.The UNIX operating system
  • 6. Sol Genomics Network Why use command-line? • Most software for biological data analysis is used through UNIX command-line terminal • Most of the servers for biological data analysis use Linux as operative system • Data analysis on calculation servers are much faster since we can use more CPUs and RAM than in a PC (e.g.: Boyce servers has 64 cores and 1TB RAM) • Large NGS data files can not be opened or loaded in most of GUI-based software and web sites • Compression commands are useful, since NGS large data files usually are stored and shared as compressed files
  • 7. Sol Genomics Network Text handling commandsText handling commands command > file saves STDOUT in a file command >> file appends STDOUT in a file cat file concatenate and print files cat file1 file2 > file3 merges files 1 and 2 into file3 cat *fasta > all.fasta concatenates all fasta files in the current directory head file prints first lines from a file head -n 5 file prints first five lines from a file tail file prints last lines from a file tail -n 5 file prints last five lines from a file less file view a file less -N file includes line numbers less -S file wraps long lines grep ‘pattern’ file Prints lines matching a pattern grep -c ‘pattern’ file counts lines matching a pattern cut -f 1,3 file retrieves data from selected columns in a tab-delimited file sort file sorts lines from a file sort -u file sorts and return unique lines uniq -c file filters adjacent repeated lines wc file counts lines, words and bytes paste file1 file2 concatenates the lines of input files paste -d “,” concatenates the lines of input files by commas sed transforms text File system CommandsFile system Commands ls lists directories and files ls -a lists all files including hidden files ls -lh formatted list including more data ls -t lists sorted by date pwd returns path to working directory cd dir changes directory cd .. goes to parent directory cd / goes to root directory cd goes to home directory touch file_name creates en empty file cp file file_copy copy a file cp -r copy files contained in directories rm file deletes a file rm -r dir deletes a directory and its files mv file1 file2 moves or renames a file mkdir dir_name creates a directory rmdir dir_name deletes a directory locate file_name searches a file man command shows commands manual top shows process activity df -h shows disk space info Networking CommandsNetworking Commands wget URL download a file from an URL ssh user@server connects to a server scp copy files between computers apt-get install installs applications in linux Compression commandsCompression commands gzip/zip compress a file gunzip/unzip decompress a file tar -cvf groups files tar -xvf ungroups files tar -zcvf groups and gzip files tar -zxvf gunzip and ungroups files UNIX Command-Line Cheat Sheet BTI-SGN Bioinformatics Course 2014 •File system commands File system navigation http://www.slideshare.net/NoFernndezPozo/unix-command-sheet2014 https://btiplantbioinfocourse.files.wordpress.com/2014/02/unix_command_sheet_2014.pdf Download the cheat sheet from:
  • 8. Sol Genomics Network File system navigation File Browser Terminal =
  • 9. Sol Genomics Network Home and Root directories /bin, /lib, /usr code and code libraries /var logs and other data /home user directories /tmp temporary files /etc configuration information /proc special file system in Linux /home/bioinfo /home/noe /home/noe/Desktop Root directory Home directory
  • 10. Sol Genomics Network Anatomy of a UNIX command grep -c -A 3 --ignore-case file.txt command Simple option flag (short form) option (long form)option with argument argument man grep print grep manual
  • 11. Sol Genomics Network ls, cd and pwd to navigate the file system • where am I? pwd • how to change current directory cd • what files and directories are in my current directory? ls pwd return current work directory
  • 12. Sol Genomics Network ls list directories and files in current directory ls lists directories and files ls -a list all directories and files, including hidden files ls -l -h -t time sorted ls -lhS size sorted ls -l -h list in long format human readable
  • 13. Sol Genomics Network ls lists directories and files r readable w writable x executable or searchable - not rwx d Directory - Regular file d rwx r-x r-x user group other owner user permissions owner group date File namesizelinks #
  • 14. Sol Genomics Network Use up and down arrows to navigate the command history Wildcards, history and some shortcuts ls *txt ls P*s list files starting with P and ending with s, e.g.: Pictures, Photos, Programs ... list all txt files in current directory ctrl-c stop process ctrl-a go to begin of line ctrl-e go to end of line ctrl-r search in command history
  • 15. Sol Genomics Network Escaping special characters Tip: file names in lower case and with underscores instead of spaces ! @ $ ^ & * ~ ? . | / [ ] < > ` " ;# ( ) Use tab key to autocomplete names ls my folder list a folder containing a space ls my_folder list a folder
  • 16. Sol Genomics Network Use tab key to autocomplete names cd changes directory cd Desktop changes directory to Desktop cd .. goes to parent directory cd goes to home directory cd / goes to root directory cd - goes to previous directory
  • 17. Sol Genomics Network Absolute and relative paths ls /home/user/Desktop list files in Desktop using an absolute path ls Desktop/ list files in Documents using a relative path (from your home: /home/bioinfo) ls ~/Desktop list files in Desktop using your home as a reference
  • 18. Sol Genomics Network Absolute and relative paths ls /home/bioinfo/Desktop ls ~/Desktop Absolute paths do not depend on where you are ~/ is equivalent to /home/bioinfo/
  • 19. Sol Genomics Network Absolute and relative paths ls ../Documents cd Desktop/ goes to Desktop from when you are in your home (/home/bioinfo) list files from Documents when you are in Desktop
  • 20. Sol Genomics Network Create, copy, move and delete files touch tmp_file.txt creates an empty file called tmp_file.txt cp tmp_file.txt file_copy.txt copies tmp_file.txt in file_copy.txt rm file.txt deletes file.txt mv file1.txt file2.txt moves or rename a file Tip: file names in lower case and with underscores instead of spaces
  • 21. Sol Genomics Network Locate a file locate unix_class_file_samples.zip Locate the path for the file unix_class_file_samples.zip locate unix_class Locate the path for all the files containing unix_class
  • 22. Sol Genomics Network Create, copy and delete directories mkdir dir_name creates an empty directory called dir_name rmdir dir_name deletes dir_name directory if it is empty cp -r dir_name dir_copy copy dir_name and its files in a new folder rm -r dir_name delete dir_name and its files
  • 23. Sol Genomics Network wc file counts lines, words and bytes paste file1 file2 concatenates the lines of input files paste -d “,” concatenates the lines of input files by commas sed transforms text locate file_name searches a file man command shows commands manual top shows process activity df -h shows disk space info Networking CommandsNetworking Commands wget URL download a file from an URL ssh user@server connects to a server scp copy files between computers apt-get install installs applications in linux Compression commandsCompression commands gzip/zip compress a file gunzip/unzip decompress a file tar -cvf groups files tar -xvf ungroups files tar -zcvf groups and gzip files tar -zxvf gunzip and ungroups files Text handling commandsText handling commands command > file saves STDOUT in a file command >> file appends STDOUT in a file cat file concatenate and print files cat file1 file2 > file3 merges files 1 and 2 into file3 cat *fasta > all.fasta concatenates all fasta files in the current directory head file prints first lines from a file head -n 5 file prints first five lines from a file tail file prints last lines from a file tail -n 5 file prints last five lines from a file less file view a file less -N file includes line numbers less -S file wraps long lines grep ‘pattern’ file Prints lines matching a pattern grep -c ‘pattern’ file counts lines matching a pattern cut -f 1,3 file retrieves data from selected columns in a tab-delimited file sort file sorts lines from a file sort -u file sorts and return unique lines uniq -c file filters adjacent repeated lines wc file counts lines, words and bytes paste file1 file2 concatenates the lines of input files paste -d “,” concatenates the lines of input files by commas sed transforms text File system CommandsFile system Commands ls lists directories and files ls -a lists all files including hidden files ls -lh formatted list including more data ls -t lists sorted by date pwd returns path to working directory cd dir changes directory cd .. goes to parent directory cd / goes to root directory cd goes to home directory touch file_name creates en empty file cp file file_copy copy a file cp -r copy files contained in directories rm file deletes a file rm -r dir deletes a directory and its files mv file1 file2 moves or renames a file mkdir dir_name creates a directory rmdir dir_name deletes a directory locate file_name searches a file man command shows commands manual top shows process activity df -h shows disk space info Networking CommandsNetworking Commands wget URL download a file from an URL ssh user@server connects to a server scp copy files between computers apt-get install installs applications in linux Compression commandsCompression commands gzip/zip compress a file gunzip/unzip decompress a file tar -cvf groups files tar -xvf ungroups files tar -zcvf groups and gzip files tar -zxvf gunzip and ungroups files UNIX Command-Line Cheat Sheet BTI-SGN Bioinformatics Course 2014 Compression commands tar -zcvf file.tar.gz f1 f2 groups and compress files tar -zxvf file.tar.gz decompress and ungroup a tar.gz file files, directories or wildcards
  • 24. Sol Genomics Network Compression commands gzip f1.txt gunzip file.gz unzip file.zip decompress file.zip zip file.zip f1 f2 compress files f1 and f2 in file.zip compress file f1.txt in f1.txt.gz decompress file.gz
  • 25. Sol Genomics Network Text handling commandsText handling commands command > file saves STDOUT in a file command >> file appends STDOUT in a file cat file concatenate and print files cat file1 file2 > file3 merges files 1 and 2 into file3 cat *fasta > all.fasta concatenates all fasta files in the current directory head file prints first lines from a file head -n 5 file prints first five lines from a file tail file prints last lines from a file tail -n 5 file prints last five lines from a file less file view a file less -N file includes line numbers less -S file wraps long lines grep ‘pattern’ file Prints lines matching a pattern grep -c ‘pattern’ file counts lines matching a pattern cut -f 1,3 file retrieves data from selected columns in a tab-delimited file sort file sorts lines from a file sort -u file sorts and return unique lines uniq -c file filters adjacent repeated lines wc file counts lines, words and bytes paste file1 file2 concatenates the lines of input files paste -d “,” concatenates the lines of input files by commas sed transforms text File system CommandsFile system Commands ls lists directories and files ls -a lists all files including hidden files ls -lh formatted list including more data ls -t lists sorted by date pwd returns path to working directory cd dir changes directory cd .. goes to parent directory cd / goes to root directory cd goes to home directory touch file_name creates en empty file cp file file_copy copy a file cp -r copy files contained in directories rm file deletes a file rm -r dir deletes a directory and its files mv file1 file2 moves or renames a file mkdir dir_name creates a directory rmdir dir_name deletes a directory locate file_name searches a file man command shows commands manual top shows process activity df -h shows disk space info Networking CommandsNetworking Commands wget URL download a file from an URL ssh user@server connects to a server scp copy files between computers apt-get install installs applications in linux Compression commandsCompression commands gzip/zip compress a file gunzip/unzip decompress a file tar -cvf groups files tar -xvf ungroups files tar -zcvf groups and gzip files tar -zxvf gunzip and ungroups files UNIX Command-Line Cheat Sheet BTI-SGN Bioinformatics Course 2014 •Networking commands Networking Commands
  • 26. Sol Genomics Network scp noe@boyce.sgn.cornell.edu:/home/noe/file.txt . copy file.txt from your home in the server to the current directory in your computer Networking Commands wget http://btiplantbioinfocourse.files.wordpress.com/2014/01/unix_command_sheet_2014.pdf downloads the UNIX command line cheat sheet PDF file ssh user_name@server_adress connects your terminal to your account in a server Tip: use the command pwd to get the path for cp and scp
  • 27. Sol Genomics Network scp file.txt noe@boyce.sgn.cornell.edu: copy file.txt from the current directory in my computer to my home in the server Networking Commands ssh noe@boyce.sgn.cornell.edu connects my terminal to my account Boyce, the BTI server scp -r dir/ noe@boyce.sgn.cornell.edu: copy the folder dir and all its files and subdirectories to my home in the server
  • 28. Sol Genomics Network Useful commands in the server top display and update sorted information about processes df -h shows disk space information
  • 29. Sol Genomics Network q quit u user (top -u user) M sort by memory usage Top displays and update sorted information about processes
  • 30. Sol Genomics Network Commands to install software sudo apt-get install pbzip2 installs pbzip2 in your computer call the command with super user permissions aptitude search blast sudo aptitude install blast2
  • 31. Sol Genomics Network 1. Go to your Desktop directory using the command cd 2. Use the command touch to create a file called: Do not Use “special characters” in file names!.txt 3. Use the command rm to delete that file 4. Use the command mkdir to create a folder called unix_data in your desktop 5. Copy the file unix_class_file_samples.zip from your folder Data, in your home, to the folder unix_data, in your desktop 6. Uncompress the file unix_class_file_samples.zip in /home/bioinfo/Desktop/unix_data 7. Use the command rm with the option -r to remove the _MACOSX folder 8. Use the command wget to download the “UNIX command line cheat sheet” PDF from: https://btiplantbioinfocourse.files.wordpress.com/2014/02/unix_command_sheet_2014.pdf Exercises