
\documentclass{beamer}

%\usepackage[dvips]{graphicx}
%\usepackage{setspace}
%\usepackage{subfigure}
%\usepackage{times}
%\usepackage{pstricks}


% packages from the original document for GLM
\usepackage{etex} 
\usepackage{german}
\usepackage{ulem}
\usepackage[german, english]{babel}
\usepackage{alltt}
\usepackage[latin1]{inputenc}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{url}
\usepackage{latexsym}
\usepackage{cgloss4e} %this is for examples
\usepackage{gb4e-modif} %this is for examples
\usepackage{colortbl}
\usepackage{tipa}
\usepackage{booktabs} 
\usepackage{bookmark}
\let\ipa\textipa
\usepackage[round]{natbib}
\usepackage[labelformat=empty]{caption}

%\usepackage{epsfig}
%\usepackage{amsfonts}


%% graphics definiert scalebox, und pstricks auch, aber anders.
%% Daher scalebox von graphics retten:
\let\scaleboxgraphics\scalebox


\usepackage{epsfig,hyperref}
\usepackage{colortbl}
\input{epsf}
\usepackage{epsf}
%\usepackage{psfig}

\DeclareGraphicsExtensions{.eps, .pdf, .ps, .png, .jpg, .gif}

\mode<presentation>
{
  \usetheme{Singapore}
  \setbeamercovered{transparent}
}

\usepackage[english]{babel}
%\usepackage[latin1]{inputenc}
\usepackage{multimedia}
\usepackage{hyperref}
\usepackage{times}
\usepackage[T1]{fontenc}


%\newtheorem{definition}{}
\newcommand{\lo}{\ensuremath{\prec\ }}
\newcommand{\po}{\ensuremath{\sqsubseteq\ }}
\newcommand{\folgt}{\ensuremath{\rightarrow\ }}

\title[Introduction to Unix for beginners] {Introduction to Unix for beginners}
\author[Gerstenberger] {Ciprian-Virgil Gerstenberger}
\institute[UiT]{UiT The Arctic University of Norway}
\titlegraphic{\scalebox{0.30}[0.30]{\includegraphics{img/uit_new.png}}}
\date[26.-30.06.2017]{{\it 26.-30.06.2017 Troms\o}}

%\setbeamercolor{normal text}{bg=red!20}
%\setbeamertemplate{background canvas}[vertical shading][top=blue!60!black, bottom=red!60!black]

\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Introduction to Unix}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%%---------------------------------------------------------------------------------------------------------------------

\begin{frame}
  \frametitle{Introduction to Unix}
  \vspace*{-6.0ex}
  \tableofcontents[pausesections]
\end{frame}

%%---------------------------------------------------------------------------------------------------------------------
%%---------------------------------------------------------------------------------------------------------------------

\section{{\bf Why command line?}}
\subsection{}

\begin{frame}
  \frametitle{Human-Computer Interaction}

\vspace{-3ex}
  
     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.25}[0.25]{\includegraphics{img/cli_vs_gui_00.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{CLI vs. GUI}
  \begin{itemize}
  \item[$\rhd$] location: \textbf{pwd} print working directory
  \item[$\rhd$] content: \textbf{ls} list directory contents
  \end{itemize}

  \vspace{-1ex}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.11}[0.11]{\includegraphics{img/cli_vs_gui_01.jpg}}}
       \end{flushleft}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{CLI vs. GUI}
  \begin{itemize}
  \item[$\rhd$] location via GUI: \textbf{click on the current directory icon}
  \item[$\rhd$] content via GUI: \textbf{default}
  \end{itemize}

  \vspace{-1ex}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.11}[0.11]{\includegraphics{img/gui_pwd.jpg}}}
       \end{flushleft}
     \end{figure}
\end{frame}


\begin{frame}
  \frametitle{CLI vs. GUI}
  \begin{itemize}
  \item[$\rhd$] GUI: \textbf{rename}
  \end{itemize}

  \vspace{-1ex}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.11}[0.11]{\includegraphics{img/cli_vs_gui_rename_02.jpg}}}
       \end{flushleft}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{CLI vs. GUI}

  \begin{itemize}
  \item[$\rhd$] GUI: \textbf{gogo3.txt $\rightarrow$ blabla.txt}
  \end{itemize}

  \vspace{-1ex}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.11}[0.11]{\includegraphics{img/cli_vs_gui_rename_03.jpg}}}
       \end{flushleft}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{CLI vs. GUI}

  \begin{itemize}
  \item[$\rhd$] CLI move: \textbf{mv gogo2.txt whatevername.txt}
  \end{itemize}

  \vspace{-1ex}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.11}[0.11]{\includegraphics{img/cli_vs_gui_rename_mv_04.jpg}}}
       \end{flushleft}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{CLI vs. GUI: SQL}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/cli_vs_gui_sql.jpg}}}
       \end{center}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{Why command line?}


  \begin{itemize}
  \item[$\rhd$] xfst, hfst, or vislcg3 do not have GUI
  \item[$\rhd$] rich collection of Unix text processing utilities
  \end{itemize}

\end{frame}

%%---------------------------------------------------------------------------------------------------------------------
%%---------------------------------------------------------------------------------------------------------------------

\section{{\bf Commands}}
\subsection{}

\begin{frame}
  \frametitle{Basic syntax}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.50}[0.50]{\includegraphics{img/cmd-anatomy.jpg}}}
       \end{flushleft}
     \end{figure}

  \vspace{-1ex}
     
  \begin{itemize}
     \item[$\rhd$] default argument:\\ \textbf{ls .}\\ \textbf{ls}
  \end{itemize}
     
\end{frame}

\begin{frame}
  \frametitle{"Deictic elements" and paths}

\textbf{Three deictic elements}
  \begin{itemize}
     \item[$\rhd$] current directory \textbf{.} mother directory \textbf{..} home directory \textbf{\textasciitilde}
  \end{itemize}

\textbf{Relative paths}
  \vspace{-1ex}
     \begin{figure}
%       \begin{center}
         \mbox{\scaleboxgraphics{0.13}[0.13]{\includegraphics{img/relative_paths.jpg}}}
%       \end{center}
     \end{figure}

\textbf{Absolute paths}
  \vspace{-1ex}
     \begin{figure}
%       \begin{center}
         \mbox{\scaleboxgraphics{0.13}[0.13]{\includegraphics{img/absolute_paths.jpg}}}
%       \end{center}
     \end{figure}

\end{frame}


\begin{frame}
  \frametitle{Chaining commands, IO redirection}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/command_combination.jpg}}}
       \end{center}
     \end{figure}

  \vspace{-1ex}
     
  \begin{itemize}
     \item[$\rhd$] pipe:  output of cmdA is input of cmdB \textbf{cmdA | cmdB}
     \item[$\rhd$] IO redirection:
       \begin{itemize}
         \item read from file \textbf{ cmdA $<$ file.txt}
         \item write to file \textbf{cmdA $>$ file.txt}
         \item append to file \textbf{cmdA $>>$ file.txt}
       \end{itemize}
  \end{itemize}
     
\end{frame}

\begin{frame}
  \frametitle{Man pages (1)}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_pwd.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Man pages (2)}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_01.jpg}}}

           \vspace{1ex}

         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_02.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Man pages (3)}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_03.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{man vislcg3}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_vislcg_command.jpg}}}

           \vspace{1ex}

         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_vislcg.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{which vislcg3}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.25}[0.25]{\includegraphics{img/which_vislcg3.jpg}}}
       \end{center}
     \end{figure}

  \begin{itemize}
     \item[$\rhd$] absolute path of the installed programm
  \end{itemize}

\end{frame}


\begin{frame}
  \frametitle{apropos vislcg3}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.14}[0.14]{\includegraphics{img/apropos_vislcg3.jpg}}}
       \end{center}
     \end{figure}

  \begin{itemize}
     \item[$\rhd$] the more specific search the more specific results
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{man lookup, apropos lookup}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/man_lookup.jpg}}}

           \vspace{1ex}

         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/apropos_lookup.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{<TAB><TAB> and -h(elp) to the rescue}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/lookup_help.jpg}}}

           \vspace{1ex}

         \mbox{\scaleboxgraphics{0.20}[0.20]{\includegraphics{img/which_lookup.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Environment variables}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/variables.jpg}}}

           \vspace{1ex}

         \mbox{\scaleboxgraphics{0.25}[0.25]{\includegraphics{img/gthome.jpg}}}
       \end{center}
     \end{figure}

  \begin{itemize}
     \item[$\rhd$] declared in \textasciitilde/.profile or \textasciitilde/.bashrc
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{Searching string patterns in files: grep}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/grep_ara_01.jpg}}}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/grep_ara_02.jpg}}}
       \end{center}
     \end{figure}

  \begin{itemize}
     \item[$\rhd$] \textbf{wildcards}: "*",  ".", "?" (quantification in regular expressions)
     \item[$\rhd$] \textbf{masking characters}: "\char`\\." (quote vs.\ use)\\
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{Using flags: grep -i --color="auto"}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/g_alias_01.jpg}}}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/g_alias_02.jpg}}}
       \end{center}
     \end{figure}

  \begin{itemize}
     \item[$\rhd$] \textbf{better output} 
     \item[$\rhd$] \textbf{What does \textit{g} mean?} 
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{Aliasing}

  \begin{itemize}
     \item[$\rhd$] \textbf{save time by typing less:}\\
    compare to environment variable declaration
  \end{itemize}

           \vspace{-2ex}


     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/alias_g_v.jpg}}}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/v_profile_alias.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{More aliasing: usma, usme}

  \begin{itemize}
     \item[$\rhd$] \textbf{u$=$upper side}\\
     \item[$\rhd$] \textbf{sma$=$South Saami}\\
  \end{itemize}

    \vspace{-2ex}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/usma.jpg}}}
       \end{center}
     \end{figure}
\end{frame}

\begin{frame}
  \frametitle{More aliasing: usme}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/usme.jpg}}}
       \end{center}
     \end{figure}

\Huge{
  \begin{itemize}
     \item[$\Rightarrow$] \textbf{Finally an error!}\\
  \end{itemize}
}
\end{frame}

\begin{frame}
  \frametitle{Coping with errors: usme}

  \begin{itemize}
     \item[$\rhd$] \textbf{understand it}\\
     \item[$\rhd$] \textbf{correct it}\\
  \end{itemize}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.15}[0.15]{\includegraphics{img/usme.jpg}}}

         \vspace{2ex}

              $\Rightarrow$ \textbf{generate the analyser-gt-desc.xfst file}

       \end{flushleft}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Coping with errors: vislcg3}

     \begin{figure}
       \begin{flushleft}
         \mbox{\scaleboxgraphics{0.20}[0.20]{\includegraphics{img/visl_error.jpg}}}

         \vspace{2ex}
         
              $\Rightarrow$ \textbf{give the grammar file as argument to vislcg3}

       \end{flushleft}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Quick reference: cheat sheet 1}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.17}[0.17]{\includegraphics{img/commands_cheatsheet_01.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Quick reference: cheat sheet 2}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.17}[0.17]{\includegraphics{img/commands_cheatsheet_02.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{Quick reference: cheat sheet 3}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.17}[0.17]{\includegraphics{img/commands_cheatsheet_03.jpg}}}
       \end{center}
     \end{figure}

\end{frame}


%%---------------------------------------------------------------------------------------------------------------------
%%---------------------------------------------------------------------------------------------------------------------


\section{{\bf And then?}}
\subsection{}

\begin{frame}
  \frametitle{Where am I now?}

  \begin{itemize}
     \item[$\rhd$] \textbf{pwd} print working directory
  \end{itemize}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.20}[0.20]{\includegraphics{img/pwd_ex.jpg}}}
       \end{center}
     \end{figure}

\end{frame}

\begin{frame}
  \frametitle{How to navigate between directories?}

         \vspace{1ex}

  \begin{itemize}
     \item[$\rhd$]  change directory: \textbf{cd PATH-TO-DIRECTORY-B} 
     \item[$\rhd$]  push directory: \textbf{pushd PATH-TO-DIRECTORY-B} 
     \item[$\rhd$]  pop directory: \textbf{popd} 
  \end{itemize}
  
         \vspace{-2ex}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.20}[0.20]{\includegraphics{img/shell_navigation_01.jpg}}}
       \end{center}
     \end{figure}

\end{frame}



\begin{frame}
  \frametitle{Push it as far as you want!}

     \begin{figure}
       \begin{center}
         \mbox{\scaleboxgraphics{0.20}[0.20]{\includegraphics{img/shell_navigation_02.jpg}}}
       \end{center}
     \end{figure}
           \vspace{-2ex}
  \begin{itemize}
     \item[$\rhd$]  stack: \textbf{FILO (first in last out)} 
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{Practice, practice, practice} 

  \begin{itemize}
  \item[$\rhd$] Which command type do you need?

  \item[$\rhd$] Where to find information about it?

  \item[$\rhd$] How to interpret error messages?

  \end{itemize}
  
           \vspace{2ex}

      \begin{center}
         \large{ \textbf{You are the Hercule Poirot or\\ the Miss Marple of a Unix mystery!}}
      \end{center}

\end{frame}


%%---------------------------------------------------------------------------------------------------------------------
%%---------------------------------------------------------------------------------------------------------------------

\end{document}
