SlideShare a Scribd company logo
Programming for Evolutionary Biology
           April 3rd – 19th 2013
            Leipzig, Germany




 Introduction to Unix systems
Part 2: Introducing the terminal
         Giovanni Marco Dall'Olio
         Universitat Pompeu Fabra
             Barcelona (Spain)
Schedule
   9.30 – 11.00: “What is Unix?” and hands on a 
    Fedora system
   11.30 – 12.30: Introducing the terminal
   14:30 – 16:30: Grep & Unix philosophy
   17:00 – 18:00: awk, make, and question time
What is the terminal?
   The terminal is a software that allows to execute 
    commands by typing
   Instead of clicking an icon in a menu, we call a 
    software by writing its name
How does a terminal looks
          like?
The terminal: history and
          why
   Back in the '70s, when Unix was developed, 
    computers did not have graphical interfaces
   Also, computer were mostly used for data 
    analysis.
The terminal: history and
          why
   Back in the '70s, when Unix was developed, 
    computers did not have graphical interfaces
   Also, computer were mostly used for data 
    analysis.
       ●   The most common operations were analysis of 
           datasets and manipulation of text files
Why use the terminal
           today?
   A common problem in bioinformatics is to deal 
    with big collections of text files
   The terminal is a good instrument to manage big 
    collections of text files. More than 30 years of 
    experience.
some Terminology
   Terminal emulator: the software that shows the 
    window where you type the commands, and 
    prints the output of the commands
   Interpreter: the software that translate 
    commands to the computer 
   Bash: name of the most commonly used 
    interpreter
Terminal emulator, interpreter and
                  bash


                        Bash, a terminal interpreter,will translate
                           all the commands submitted from
                                      this terminal


Terminal
Emulator
Your first command: ls
   ls is the command to show all the files in a folder
   It stands for “List Short” (list files in a short way)
   Try it!
Output of “ls”
   ls will list the files in the 
    current directory
   By default, when you 
    open the terminal, you 
    are in your “home” 
    folder
“ls” is showing the contents of the
                 “home” folder
   If you want to see which files are being shown by ls, you can type 
    nautilus as we did in the previous session
Anatomy of a command
   Each command call is usually composed by three 
    parts:
       ●   The command itself
       ●   Parameters (optionals)
       ●   Arguments 
ls: some parameters
   Parameters are optional items that can be used to 
    customize the behaviour of a command
   For example:
       ●   ls ­l shows the list of files in a long format
       ●   ls ­a shows hidden files
       ●   ls ­t list files by modification time
“ls -l”
   ls ­l shows the same files as ls, but on a more 
    detailed format
“ls -a”
   ls ­a shows all the 
    files, including the 
    hidden ones
   Hidden files have a 
    name that begin with 
    a “.” 
   Most of them are 
    configuration files, 
    you can ignore them.
“ls -t”
   ls ­t lists the files by modification date
“ls -lt”
   You can combine parameters together
   ls ­lt shows the files in a long format, sorted by 
    date
Arguments
   Arguments define the target of the command 
   On which files/folders/targets do I want to run my 
    command?
   Example: 
       ●   ls unix_intro ­> shows the files in the unix_intro 
           directory
Quick exercise
   In the following call, which are the commands, 
    the parameters and the arguments?
       ●   ls ­la /homes/evopadmin
How to get the
      documentation of a
          command?
   Three methods:
      ●   ­­help
      ●   man
      ●   info
“ls --help”
   The simplest way to get the documentation of a 
    command is by using the ­­help parameter
   For example:
      ls ­­help
   Most unix command accept a ­­help or ­h 
    parameter
Consulting the
      documentation of a
        command: man
   The command man is used to see the 
    documentation of a command
   Understanding how to read the documentation is 
    the key to learn how to use the shell
Your second command: man
    The command “man” is used to see the 
     documentation of a command
    Usage: man <name of the command>
    Try it:
        ●   man ls
“man ls”
Understanding a man page
   Each manual page is composed by at least three 
    sections:
       ●   NAME (the name of the command)
       ●   SYNOPSIS (how to launch the command)
       ●   DESCRIPTION/OPTIONS (description of what 
           the command does, and its options)
“man ls”
           Name of the command

           Synopsis (how to use it)
             Options in square
            brackets are optional




           Parameters & arguments
Using a man page
   Use arrows or PageUp/PageDown keys to scroll 
    the man page
   Press “/” followed by a word to search text
       ●   Example: /sort
   Press “q” to exit 
Searching for a man page
   You can search all the manuals using the ­k 
    option
       ●   Example: man ­k “list dir”
   Another similar command is “apropos”
       ●   Example: apropos “list dir”
Other sections in a man
             page
   SEE ALSO: some man pages contain references 
    to similar commands
   EXAMPLES: some man pages contain an 
    “examples” section
“SEE ALSO” and
“EXAMPLES” sections
“SEE ALSO” and
“EXAMPLES” sections
“man -k 'list dir'” and
      apropos
Another way to access
    documentation: “info”
   The command “info” shows a more descriptive 
    documentation of a command
   Example:
       ●   info ls
The “info” command

                   Use arrows to scroll
               Press Enter on a keyword to
                       open a page
            Press “n” and “p” to change pages
Short exercise
   Which parameter can be passed to “ls” to sort 
    files by size?
   How to show the contents of directory recursively
   Which command can be used to show the 
    contents of a folder as a tree? (hint: use apropos)
How to get help: Internet
   Apart from “­­help”, man and info, the best place 
    to look for help on a command is.. Internet!
How to get help: Internet
   Apart from “­­help”, man and info, the best place 
    to look for help on a command is.. Internet!
   Tips to get better results when searching the 
    documentation of a Unix command on Internet:
       ●   Add keywords such as “Unix”, “bash”, “fedora”
       ●   Use the “­” operator on google to remove junk 
           results
       ●   If you have problem with a software or with your 
           installation, copy and paste the error on google.
Adding keywords such as “Unix”,
  “bash”, “fedora”, “terminal”
The “-” operator on google
The “-” operator on google
Troubleshooting in Linux
Navigating the file system
    from the terminal
   We will now see how to navigate folders and files 
    from the terminal
Change directory: cd
   Let's start navigating the file system!
   The command cd allows you to move to another 
    folder
   Let's enter the folder of the course:
       ●   cd unix_intro
       ●   ls
The “cd” man page
   Note: the cd command is documented inside the 
    “bash” man page
       ●   Type man bash and then look for ls
   You can also look at: 
       ●   man dir (dir is a similar command to ls)
       ●   info coreutils ls
Which folder am I?
   If you don't know which folder are you in, you 
    can use the command pwd
   Also, if you run cd without arguments, it will 
    return to the home folder 
pwd
If you get lost: type “cd”
    without arguments
   Typing cd without arguments will bring you to 
    your home directory
“cd ..”
   “cd ..” lets you return to the parent folder 
   Example:
       ●   cd unix_intro → goes to the unix_intro folder
       ●   cd .. → returns to the home folder
A tip: bash completion
   You can use the “tab” key on the keyboard to 
    complete commands and arguments
   Example:
       ●   cd Docu<tab> will complete to cd Documents
   Thanks to tab completion, you can save a lot of 
    typing
Let's look at the files in the
        course folder
    Type, in the following order:
     cd (to go back to the home folder)
     cd /homes/evopserver/evopadmin/unix_intro (use the tab key for autocompletion)
     ls
     cd exercises
     ls

     Check with your teaching assistant that you are in the correct folder.
Let's see some “fasta” files
    Go to the folder 
     leipzig_course/unix_intro/exercises/fasta
        ●   fasta, not fastq! 
    You should see some fasta files there:
        ●   MGAT1.fasta, MGAT2.fasta, MGAT3.fasta, 
            MGAT4A.fasta, MGAT5.fasta
head & tail
   The head and tail print the first or the last lines in 
    a file
   Let's try it:
       ●   head MGAT1.fasta → the first lines of 
           MGAT1.fasta
       ●   tail MGAT3.fasta → the last lines of the file
   head and tail are useful to inspect big text files
The symbol “*”
   The symbol * (wildcard) can be used to represent 
    all the files in the current folder
   Try it:
       ●   head * → will show the first lines of all the files in 
           the folder
The man page for “head”
   Exercise: 
       ●   open the man page for head
       ●   determine which parameter is used for printing a 
           custom number of lines
“cat” & “less”
   The cat command prints the content of a file to 
    the screen
   The less command allows to read the content of a 
    file, with the same interface as for the man pages
Launching gedit from the
     command line
   Note that you can use the command line to launch 
    any software installed in the computer
       ●   gedit → text editor
       ●   google­chrome → web browser
       ●   gnome­terminal → other terminal
Other useful commands (1)
   clean → clear the terminal
   rm → delete files
   mkdir → create directory
   more → like less, good for piping
Other useful commands (2)
   echo → print a message
   history → show the history of the commands 
    typed
   dos2unix → clean files edited in MS Windows 
    notepad for unix
Resume of the session:
   man and info → documentation
   cd, ls, pwd → navigate folders
   head, less → show contents of files
Time for lunch!




 See you here at 14:30!
Ad

More Related Content

What's hot (20)

Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
Stephen Ahiante
 
Lesson 3 Working with Files in Linux
Lesson 3 Working with Files in LinuxLesson 3 Working with Files in Linux
Lesson 3 Working with Files in Linux
Sadia Bashir
 
Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals
Ahmed El-Arabawy
 
Unix- the process
Unix-  the processUnix-  the process
Unix- the process
Dr. Girish GS
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Linux commands
Linux commandsLinux commands
Linux commands
Balakumaran Arunachalam
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
Linux text editors
Linux text editorsLinux text editors
Linux text editors
InfoExcavator
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
shravan saini
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
Chandan Kumar Rana
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
vceder
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and Semantics
Tatiana Al-Chueyr
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
Md. Zahid Hossain Shoeb
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
Gaurav Shinde
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Ashrith Mekala
 
Lesson 3 Working with Files in Linux
Lesson 3 Working with Files in LinuxLesson 3 Working with Files in Linux
Lesson 3 Working with Files in Linux
Sadia Bashir
 
Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals
Ahmed El-Arabawy
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
shravan saini
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
vceder
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
Wave Digitech
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
Manav Prasad
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and Semantics
Tatiana Al-Chueyr
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
anandvaidya
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 

Viewers also liked (20)

Linux intro 5 extra: makefiles
Linux intro 5 extra: makefilesLinux intro 5 extra: makefiles
Linux intro 5 extra: makefiles
Giovanni Marco Dall'Olio
 
Linux intro 4 awk + makefile
Linux intro 4  awk + makefileLinux intro 4  awk + makefile
Linux intro 4 awk + makefile
Giovanni Marco Dall'Olio
 
Linux intro 5 extra: awk
Linux intro 5 extra: awkLinux intro 5 extra: awk
Linux intro 5 extra: awk
Giovanni Marco Dall'Olio
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
Giovanni Marco Dall'Olio
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
Giovanni Marco Dall'Olio
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
subhsikha
 
AWK Investor Presentation
AWK Investor PresentationAWK Investor Presentation
AWK Investor Presentation
RedChip Companies, Inc.
 
Intro to linux performance analysis
Intro to linux performance analysisIntro to linux performance analysis
Intro to linux performance analysis
Chris McEniry
 
Nigerian design and digital marketing agency
Nigerian design and digital marketing agencyNigerian design and digital marketing agency
Nigerian design and digital marketing agency
Samson Aligba
 
Machine Learning and Hadoop: Present and Future
Machine Learning and Hadoop: Present and FutureMachine Learning and Hadoop: Present and Future
Machine Learning and Hadoop: Present and Future
Data Science London
 
VideoLan VLC Player App Artifact Report
VideoLan VLC Player App Artifact ReportVideoLan VLC Player App Artifact Report
VideoLan VLC Player App Artifact Report
Aziz Sasmaz
 
Samsung mobile root
Samsung mobile rootSamsung mobile root
Samsung mobile root
Black Peacocks
 
History of L0phtCrack
History of L0phtCrackHistory of L0phtCrack
History of L0phtCrack
cwysopal
 
脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断って何をどうすればいいの?(おかわり)脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断研究会
 
Open Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Open Source Security Testing Methodology Manual - OSSTMM by Falgun RathodOpen Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Open Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Falgun Rathod
 
Dangerous google dorks
Dangerous google dorksDangerous google dorks
Dangerous google dorks
Witgie Solutions
 
How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF How to Setup A Pen test Lab and How to Play CTF
How to Setup A Pen test Lab and How to Play CTF
n|u - The Open Security Community
 
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Giovanni Marco Dall'Olio
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Ravi Rajput
 
Hacking in shadows By - Raghav Bisht
Hacking in shadows By - Raghav BishtHacking in shadows By - Raghav Bisht
Hacking in shadows By - Raghav Bisht
Raghav Bisht
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
subhsikha
 
Intro to linux performance analysis
Intro to linux performance analysisIntro to linux performance analysis
Intro to linux performance analysis
Chris McEniry
 
Nigerian design and digital marketing agency
Nigerian design and digital marketing agencyNigerian design and digital marketing agency
Nigerian design and digital marketing agency
Samson Aligba
 
Machine Learning and Hadoop: Present and Future
Machine Learning and Hadoop: Present and FutureMachine Learning and Hadoop: Present and Future
Machine Learning and Hadoop: Present and Future
Data Science London
 
VideoLan VLC Player App Artifact Report
VideoLan VLC Player App Artifact ReportVideoLan VLC Player App Artifact Report
VideoLan VLC Player App Artifact Report
Aziz Sasmaz
 
History of L0phtCrack
History of L0phtCrackHistory of L0phtCrack
History of L0phtCrack
cwysopal
 
脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断って何をどうすればいいの?(おかわり)脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断って何をどうすればいいの?(おかわり)
脆弱性診断研究会
 
Open Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Open Source Security Testing Methodology Manual - OSSTMM by Falgun RathodOpen Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Open Source Security Testing Methodology Manual - OSSTMM by Falgun Rathod
Falgun Rathod
 
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Giovanni Marco Dall'Olio
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Ravi Rajput
 
Hacking in shadows By - Raghav Bisht
Hacking in shadows By - Raghav BishtHacking in shadows By - Raghav Bisht
Hacking in shadows By - Raghav Bisht
Raghav Bisht
 
Ad

Similar to Linux intro 2 basic terminal (20)

The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 
Suman bhatt
Suman bhattSuman bhatt
Suman bhatt
Tapas Bayen
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
Team-VLSI-ITMU
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
Tushar Jain
 
35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf
Mangesh Dhulap
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
kavitha_tala
 
Assignment OS LAB 2022
Assignment OS LAB 2022Assignment OS LAB 2022
Assignment OS LAB 2022
INFOTAINMENTCHANNEL1
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Code tacoma command_line
Code tacoma command_lineCode tacoma command_line
Code tacoma command_line
Andrea Urban
 
Unix practical file
Unix practical fileUnix practical file
Unix practical file
Soumya Behera
 
Shell intro
Shell introShell intro
Shell intro
Teja Bheemanapally
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
saubhagya ranjan
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
AbhishekKumarSrivast36
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
ArliPutraPratama1
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
ArliPutraPratama
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
MeghrajPatil11
 
Linux commands
Linux commandsLinux commands
Linux commands
VenkatakrishnaAdari1
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
hazhamina
 
The structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformaticsThe structure of Linux - Introduction to Linux for bioinformatics
The structure of Linux - Introduction to Linux for bioinformatics
BITS
 
Unix Basics 04sp
Unix Basics 04spUnix Basics 04sp
Unix Basics 04sp
Dr.Ravi
 
Unix tutorial-08
Unix tutorial-08Unix tutorial-08
Unix tutorial-08
Tushar Jain
 
35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf35 ls Command Examples in Linux (The Complete Guide).pdf
35 ls Command Examples in Linux (The Complete Guide).pdf
Mangesh Dhulap
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
Dr.Ravi
 
Karkha unix shell scritping
Karkha unix shell scritpingKarkha unix shell scritping
Karkha unix shell scritping
chockit88
 
Code tacoma command_line
Code tacoma command_lineCode tacoma command_line
Code tacoma command_line
Andrea Urban
 
linux-commands.ppt
linux-commands.pptlinux-commands.ppt
linux-commands.ppt
hazhamina
 
Ad

More from Giovanni Marco Dall'Olio (19)

Applicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Applicazioni di chatGPT e altri LLMs per la ricerca di farmaciApplicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Applicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Giovanni Marco Dall'Olio
 
Fehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal ClubFehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal Club
Giovanni Marco Dall'Olio
 
Agile bioinf
Agile bioinfAgile bioinf
Agile bioinf
Giovanni Marco Dall'Olio
 
Version control
Version controlVersion control
Version control
Giovanni Marco Dall'Olio
 
Wagner chapter 5
Wagner chapter 5Wagner chapter 5
Wagner chapter 5
Giovanni Marco Dall'Olio
 
Wagner chapter 4
Wagner chapter 4Wagner chapter 4
Wagner chapter 4
Giovanni Marco Dall'Olio
 
Wagner chapter 3
Wagner chapter 3Wagner chapter 3
Wagner chapter 3
Giovanni Marco Dall'Olio
 
Wagner chapter 2
Wagner chapter 2Wagner chapter 2
Wagner chapter 2
Giovanni Marco Dall'Olio
 
Wagner chapter 1
Wagner chapter 1Wagner chapter 1
Wagner chapter 1
Giovanni Marco Dall'Olio
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
Giovanni Marco Dall'Olio
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
 
The true story behind the annotation of a pathway
The true story behind the annotation of a pathwayThe true story behind the annotation of a pathway
The true story behind the annotation of a pathway
Giovanni Marco Dall'Olio
 
Plotting data with python and pylab
Plotting data with python and pylabPlotting data with python and pylab
Plotting data with python and pylab
Giovanni Marco Dall'Olio
 
Makefiles Bioinfo
Makefiles BioinfoMakefiles Bioinfo
Makefiles Bioinfo
Giovanni Marco Dall'Olio
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
Giovanni Marco Dall'Olio
 
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchWeb 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Giovanni Marco Dall'Olio
 
Perl Bioinfo
Perl BioinfoPerl Bioinfo
Perl Bioinfo
Giovanni Marco Dall'Olio
 
(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008
Giovanni Marco Dall'Olio
 
Applicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Applicazioni di chatGPT e altri LLMs per la ricerca di farmaciApplicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Applicazioni di chatGPT e altri LLMs per la ricerca di farmaci
Giovanni Marco Dall'Olio
 
The true story behind the annotation of a pathway
The true story behind the annotation of a pathwayThe true story behind the annotation of a pathway
The true story behind the annotation of a pathway
Giovanni Marco Dall'Olio
 
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchWeb 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Giovanni Marco Dall'Olio
 
(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008
Giovanni Marco Dall'Olio
 

Recently uploaded (20)

RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
Com fer un pla de gestió de dades amb l'eiNa DMP (en anglès)
CSUC - Consorci de Serveis Universitaris de Catalunya
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
AI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdfAI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdf
Precisely
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
Financial Services Technology Summit 2025
Financial Services Technology Summit 2025Financial Services Technology Summit 2025
Financial Services Technology Summit 2025
Ray Bugg
 
machines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdfmachines-for-woodworking-shops-en-compressed.pdf
machines-for-woodworking-shops-en-compressed.pdf
AmirStern2
 
Config 2025 presentation recap covering both days
Config 2025 presentation recap covering both daysConfig 2025 presentation recap covering both days
Config 2025 presentation recap covering both days
TrishAntoni1
 
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
AI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdfAI You Can Trust: The Critical Role of Governance and Quality.pdf
AI You Can Trust: The Critical Role of Governance and Quality.pdf
Precisely
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 

Linux intro 2 basic terminal

  • 1. Programming for Evolutionary Biology April 3rd – 19th 2013 Leipzig, Germany Introduction to Unix systems Part 2: Introducing the terminal Giovanni Marco Dall'Olio Universitat Pompeu Fabra Barcelona (Spain)
  • 2. Schedule  9.30 – 11.00: “What is Unix?” and hands on a  Fedora system  11.30 – 12.30: Introducing the terminal  14:30 – 16:30: Grep & Unix philosophy  17:00 – 18:00: awk, make, and question time
  • 3. What is the terminal?  The terminal is a software that allows to execute  commands by typing  Instead of clicking an icon in a menu, we call a  software by writing its name
  • 4. How does a terminal looks like?
  • 5. The terminal: history and why  Back in the '70s, when Unix was developed,  computers did not have graphical interfaces  Also, computer were mostly used for data  analysis.
  • 6. The terminal: history and why  Back in the '70s, when Unix was developed,  computers did not have graphical interfaces  Also, computer were mostly used for data  analysis. ● The most common operations were analysis of  datasets and manipulation of text files
  • 7. Why use the terminal today?  A common problem in bioinformatics is to deal  with big collections of text files  The terminal is a good instrument to manage big  collections of text files. More than 30 years of  experience.
  • 8. some Terminology  Terminal emulator: the software that shows the  window where you type the commands, and  prints the output of the commands  Interpreter: the software that translate  commands to the computer   Bash: name of the most commonly used  interpreter
  • 9. Terminal emulator, interpreter and bash Bash, a terminal interpreter,will translate all the commands submitted from this terminal Terminal Emulator
  • 10. Your first command: ls  ls is the command to show all the files in a folder  It stands for “List Short” (list files in a short way)  Try it!
  • 11. Output of “ls”  ls will list the files in the  current directory  By default, when you  open the terminal, you  are in your “home”  folder
  • 12. “ls” is showing the contents of the “home” folder  If you want to see which files are being shown by ls, you can type  nautilus as we did in the previous session
  • 13. Anatomy of a command  Each command call is usually composed by three  parts: ● The command itself ● Parameters (optionals) ● Arguments 
  • 14. ls: some parameters  Parameters are optional items that can be used to  customize the behaviour of a command  For example: ● ls ­l shows the list of files in a long format ● ls ­a shows hidden files ● ls ­t list files by modification time
  • 15. “ls -l”  ls ­l shows the same files as ls, but on a more  detailed format
  • 16. “ls -a”  ls ­a shows all the  files, including the  hidden ones  Hidden files have a  name that begin with  a “.”   Most of them are  configuration files,  you can ignore them.
  • 17. “ls -t”  ls ­t lists the files by modification date
  • 18. “ls -lt”  You can combine parameters together  ls ­lt shows the files in a long format, sorted by  date
  • 19. Arguments  Arguments define the target of the command   On which files/folders/targets do I want to run my  command?  Example:  ● ls unix_intro ­> shows the files in the unix_intro  directory
  • 20. Quick exercise  In the following call, which are the commands,  the parameters and the arguments? ● ls ­la /homes/evopadmin
  • 21. How to get the documentation of a command?  Three methods: ● ­­help ● man ● info
  • 22. “ls --help”  The simplest way to get the documentation of a  command is by using the ­­help parameter  For example: ls ­­help  Most unix command accept a ­­help or ­h  parameter
  • 23. Consulting the documentation of a command: man  The command man is used to see the  documentation of a command  Understanding how to read the documentation is  the key to learn how to use the shell
  • 24. Your second command: man  The command “man” is used to see the  documentation of a command  Usage: man <name of the command>  Try it: ● man ls
  • 26. Understanding a man page  Each manual page is composed by at least three  sections: ● NAME (the name of the command) ● SYNOPSIS (how to launch the command) ● DESCRIPTION/OPTIONS (description of what  the command does, and its options)
  • 27. “man ls” Name of the command Synopsis (how to use it) Options in square brackets are optional Parameters & arguments
  • 28. Using a man page  Use arrows or PageUp/PageDown keys to scroll  the man page  Press “/” followed by a word to search text ● Example: /sort  Press “q” to exit 
  • 29. Searching for a man page  You can search all the manuals using the ­k  option ● Example: man ­k “list dir”  Another similar command is “apropos” ● Example: apropos “list dir”
  • 30. Other sections in a man page  SEE ALSO: some man pages contain references  to similar commands  EXAMPLES: some man pages contain an  “examples” section
  • 33. “man -k 'list dir'” and apropos
  • 34. Another way to access documentation: “info”  The command “info” shows a more descriptive  documentation of a command  Example: ● info ls
  • 35. The “info” command Use arrows to scroll Press Enter on a keyword to open a page Press “n” and “p” to change pages
  • 36. Short exercise  Which parameter can be passed to “ls” to sort  files by size?  How to show the contents of directory recursively  Which command can be used to show the  contents of a folder as a tree? (hint: use apropos)
  • 37. How to get help: Internet  Apart from “­­help”, man and info, the best place  to look for help on a command is.. Internet!
  • 38. How to get help: Internet  Apart from “­­help”, man and info, the best place  to look for help on a command is.. Internet!  Tips to get better results when searching the  documentation of a Unix command on Internet: ● Add keywords such as “Unix”, “bash”, “fedora” ● Use the “­” operator on google to remove junk  results ● If you have problem with a software or with your  installation, copy and paste the error on google.
  • 39. Adding keywords such as “Unix”, “bash”, “fedora”, “terminal”
  • 40. The “-” operator on google
  • 41. The “-” operator on google
  • 43. Navigating the file system from the terminal  We will now see how to navigate folders and files  from the terminal
  • 44. Change directory: cd  Let's start navigating the file system!  The command cd allows you to move to another  folder  Let's enter the folder of the course: ● cd unix_intro ● ls
  • 45. The “cd” man page  Note: the cd command is documented inside the  “bash” man page ● Type man bash and then look for ls  You can also look at:  ● man dir (dir is a similar command to ls) ● info coreutils ls
  • 46. Which folder am I?  If you don't know which folder are you in, you  can use the command pwd  Also, if you run cd without arguments, it will  return to the home folder 
  • 47. pwd
  • 48. If you get lost: type “cd” without arguments  Typing cd without arguments will bring you to  your home directory
  • 49. “cd ..”  “cd ..” lets you return to the parent folder   Example: ● cd unix_intro → goes to the unix_intro folder ● cd .. → returns to the home folder
  • 50. A tip: bash completion  You can use the “tab” key on the keyboard to  complete commands and arguments  Example: ● cd Docu<tab> will complete to cd Documents  Thanks to tab completion, you can save a lot of  typing
  • 51. Let's look at the files in the course folder  Type, in the following order: cd (to go back to the home folder) cd /homes/evopserver/evopadmin/unix_intro (use the tab key for autocompletion) ls cd exercises ls Check with your teaching assistant that you are in the correct folder.
  • 52. Let's see some “fasta” files  Go to the folder  leipzig_course/unix_intro/exercises/fasta ● fasta, not fastq!   You should see some fasta files there: ● MGAT1.fasta, MGAT2.fasta, MGAT3.fasta,  MGAT4A.fasta, MGAT5.fasta
  • 53. head & tail  The head and tail print the first or the last lines in  a file  Let's try it: ● head MGAT1.fasta → the first lines of  MGAT1.fasta ● tail MGAT3.fasta → the last lines of the file  head and tail are useful to inspect big text files
  • 54. The symbol “*”  The symbol * (wildcard) can be used to represent  all the files in the current folder  Try it: ● head * → will show the first lines of all the files in  the folder
  • 55. The man page for “head”  Exercise:  ● open the man page for head ● determine which parameter is used for printing a  custom number of lines
  • 56. “cat” & “less”  The cat command prints the content of a file to  the screen  The less command allows to read the content of a  file, with the same interface as for the man pages
  • 57. Launching gedit from the command line  Note that you can use the command line to launch  any software installed in the computer ● gedit → text editor ● google­chrome → web browser ● gnome­terminal → other terminal
  • 58. Other useful commands (1)  clean → clear the terminal  rm → delete files  mkdir → create directory  more → like less, good for piping
  • 59. Other useful commands (2)  echo → print a message  history → show the history of the commands  typed  dos2unix → clean files edited in MS Windows  notepad for unix
  • 60. Resume of the session:  man and info → documentation  cd, ls, pwd → navigate folders  head, less → show contents of files
  • 61. Time for lunch! See you here at 14:30!
  翻译: