tutorials:b4b

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:b4b [2019/10/30 13:56] – [Grabbing information in a file from the command line] albarrontutorials:b4b [2019/11/06 10:36] (current) – [Location and time] albarron
Line 1: Line 1:
 ====== Bash for Beginners ====== ====== Bash for Beginners ======
  
-This quick-and-dirty tutorial is intended as an introduction to [[https://www.gnu.org/software/bash/|bash]] for beginners+This quick-and-dirty tutorial is intended as an introduction to [[https://www.gnu.org/software/bash/|bash]]. The natural language used during the tutorial will be English
  
 ====== Location and time ====== ====== Location and time ======
  
-The tutorial will be held in Room 4 of the PhD Lab on Wednesday 6 November from 9.15 to 10.45. +The tutorial was held in Room 4 of the PhD Lab on Wednesday 6 November from 9.15 to 10.45. 
  
 ===== Requirements ===== ===== Requirements =====
Line 11: Line 11:
 In order to follow the tutorial, you will require a laptop. Depending on your operative system, you will require **one** of the following:  In order to follow the tutorial, you will require a laptop. Depending on your operative system, you will require **one** of the following: 
  
-  * **Windows machine**. You have to install both [[http://www.9bis.net/kitty/#!index.md|KiTTy]] and [[kscp]]. You can find a zip file with both [[here]].+  * **Windows machine**. You have to download both [[http://www.9bis.net/kitty/#!index.md|KiTTy]] and [[http://www.9bis.net/kitty/files/kscp.exe|kscp]]. You can find a zip file with both {{ :tutorials:b4b:b4b_essentials.zip|here}}.
   * **Mac**. Nothing extra. You are ready to go.   * **Mac**. Nothing extra. You are ready to go.
   * **Linux**. Nothing extra. You are ready to go.   * **Linux**. Nothing extra. You are ready to go.
  
 +===== Resources =====
 +
 +We'll use a small subset of the English-Italian part of the Europarl parallel corpus.
 +
 +Download the two files here: {{:tutorials:b4b:en.zip|English}} and {{:tutorials:b4b:it.zip|Italian}}
  
 ===== Why is bash relevant? ===== ===== Why is bash relevant? =====
  
 +  * Quick and easy text and data processing
 +  * The right way to interact with real computing software
 +  * One gate to Python and deep learning
 +===== Hands on Bash =====
  
  
Line 23: Line 32:
  
  
-===== Find yourself at home =====+ 
 +==== Find yourself at home ====
  
 You will first learn how to setup a remote connection to the machine You will first learn how to setup a remote connection to the machine
Line 35: Line 45:
 Files can be simply displayed (without performing any modification) or actually opened for edition purposes. You will learn to do both.  Files can be simply displayed (without performing any modification) or actually opened for edition purposes. You will learn to do both. 
  
-Commands: ''cat'', ''more'', ''less'', ''most'', ''wc'', ''nano'' +Commands: ''cat'', ''more'', ''less'', ''most'', ''wc'', ''nano'', ''head'', ''shuf'' 
 + 
 ==== Grabbing information in a file from the command line ==== ==== Grabbing information in a file from the command line ====
    
Line 46: Line 58:
 All the operations carried out show their result in the terminal, but do not alter the contents nor are stored anywhere. Now we learn how to store them. All the operations carried out show their result in the terminal, but do not alter the contents nor are stored anywhere. Now we learn how to store them.
  
-Commands: ''te'', ''>'', ''>>''+Commands: ''>'', ''%%>>%%''
  
 ==== Understanding the structure of the commands ==== ==== Understanding the structure of the commands ====
Line 54: Line 66:
 ==== Piping to combine commands  ==== ==== Piping to combine commands  ====
  
-Let's start making things interesting: all these commands can be executed one after the other at no extra cost. +Let's start making things interesting: all these commands can be executed one after the other at no extra cost. These are the so-called **one-liners**.
  
-Commands: ''|''+Commands: ''awk'', ''|''
  
-==== One-liners ==== 
  
 ==== How to find some help ==== ==== How to find some help ====
  
 Commands: ''man'' Commands: ''man''
 +
 +==== Exercises ====
 +
 +**EXERCISE 1**. Let us "measure" a file: bytes, megabytes, lines, words, etc.
 +
 +**EXERCISE 2**. Shuffle a parallel corpus in order to have sentences from different speeches. 
 +
 +**EXERCISE 3**. Find the most frequent tokens in the two parts of a parallel corpus and analyse them.
 +
 +**EXERCISE 4**. Get all words which are cognates wrt Italian from a tsv dictionary. Afterwards, count the number of tokens which belong to each family. 
 +
  • tutorials/b4b.1572443770.txt.gz
  • Last modified: 2019/10/30 13:56
  • by albarron