% Created 2026-09-20 Sun 13:03
% Intended LaTeX compiler: lualatex
\documentclass[11pt]{article}

\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{minted}
\usepackage{td}
\author{\href{mailto:samuel.ortion@universite-paris-saclay.fr}{samuel.ortion@universite-paris-saclay.fr}}
\date{}
\title{TP n°3 Unix}
\hypersetup{
 pdfauthor={\href{mailto:samuel.ortion@universite-paris-saclay.fr}{samuel.ortion@universite-paris-saclay.fr}},
 pdftitle={TP n°3 Unix},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={},
 pdflang={English}}
\usepackage{biblatex}

\begin{document}

\maketitle
\textbf{Foreword}

Wind turbines have an impact on biodiversity inducing an increase in bird and bat mortality. The main cause of this mortality is not the collision between the organism and the rotor blade but rather because of the high pressure induced by the rotation of the wind turbine.

The DREAL of the ``Hauts de France'' region deposits on data.gouv.fr a database that is updated regularly counting the dead corpse of bird and bats close to the wind turbine \footnote{Data source: \url{https://www.data.gouv.fr/datasets/cadavres-doiseaux-et-de-chiropteres-retrouves-au-pied-des-eoliennes/} (visited on 7 novembre 2025).}.


The objective of this practical exercise is to analyse some of these data using Unix commands.
\section{Questions}
\label{sec:org69d47aa}

\begin{enumerate}
\item How many corpse was discovered during the year 2020?
\item Count the number of corpse discovered per species. Which species was the most commonly found? Use the command \texttt{uniq -c}.
\item Use an \texttt{awk} script to answer the same question \footnote{In the GNU Awk implementation, we have the function \texttt{asorti} which allows to sort a table. This might be useful.}
\item Two main taxonomic groups are affected by wind turbines: bats and birds.
In the file ``bird.txt'' you have the list of bird species referenced in the database.
Using this list, extract the list of other taxa (i.e., non bird taxa).
\item Based on the list of birds and bats, and using the commands \texttt{sort}, \texttt{join}, \texttt{cut} and \texttt{uniq} check that we found more bird corpses than bat corpses.
\item Looking at the content of the file \texttt{bird.txt}, maybe you discovered that the binomial names of the species were not always formatted with the genus name and species name as the standard \emph{Genus species} format, with the first letter of the genus name in uppercase.

Using an awk script, fix the formatting of all binomial names.

\emph{Hint} Don't forget the \texttt{toupper} and \texttt{substr} command.
\end{enumerate}
\end{document}
