Commit dc04546a authored by Mihai's avatar Mihai

Some cleaning.

parent f81cd4dc
*.aux
*.log
*.nav
*.out
*.pdf
*.snm
*.sty
*.toc
*.vrb
*.backup
/images/help/*
*/logos
*/Makefile
*/_minted-*
practical_files/practical_files.tar.gz
images/other/*
introduction/images/*
credentials*
past_sessions/*
evaluations/*
Subproject commit e9385ca9d21c3e2b42da4f4287daa33f76cf96d5
Subproject commit 59a5d03fe8dddd30402d72e43e6f78da4667d2e4
......@@ -138,7 +138,7 @@ The entire course material is available online at the following address:\\
\end{center}
\bigskip
\input{../core/commands_cheatsheet_content}
\input{../cheatsheet/commands_cheatsheet_content}
......
......@@ -222,7 +222,7 @@
\textcolor{command-color}{\lstinline{find}} \textcolor{argument-color}{\lstinline{[path]...}} \textcolor{option-color}{\lstinline{[option]...}} \textcolor{argument-color}{\lstinline{[expression]}}\\
Search for files and directories based on the given \textcolor{argument-color}{\lstinline{expression}}.\\
Many options and ways to specify the \textcolor{argument-color}{\lstinline{expression}} - check man page.
Many options and ways to specify the \textcolor{argument-color}{\lstinline{expression}} - check the manual page.
\medskip
\textcolor{command-color}{\lstinline{grep}} \textcolor{option-color}{\lstinline{[option]...}} \textcolor{argument-color}{\lstinline{[pattern] [file/directory]...}}\\
......@@ -248,11 +248,17 @@
Print the number of lines, words, and characters for each \textcolor{argument-color}{\lstinline{file}}.
\medskip
\subsection*{Output redirection}
\subsection*{Output redirection operators}
\textcolor{command-color}{\lstinline{command}} \textcolor{redirection}{\lstinline{>}} \textcolor{argument-color}{\lstinline{file}}\\
Redirect the output of \textcolor{command-color}{\lstinline{command}} to the \textcolor{argument-color}{\lstinline{file}}.
Redirect the \textcolor{command-color}{\lstinline{command}} output to the specified \textcolor{argument-color}{\lstinline{file}}.\\
If \textcolor{argument-color}{\lstinline{file}} already exists it will be overwritten.
\medskip
\subsection*{User Environment}
\textcolor{command-color}{\lstinline{command}} \textcolor{redirection}{\lstinline{>>}} \textcolor{argument-color}{\lstinline{file}}\\
Redirect the \textcolor{command-color}{\lstinline{command}} output to the specified \textcolor{argument-color}{\lstinline{file}}.\\
If \textcolor{argument-color}{\lstinline{file}} already exists the \textcolor{command-color}{\lstinline{command}} output will be appended to the \textcolor{argument-color}{\lstinline{file}}.
\subsection*{User environment}
\textcolor{command-color}{\lstinline{chmod}} \textcolor{option-color}{\lstinline{option}} \textcolor{argument-color}{\lstinline{file/directory}}\\
Change \textcolor{argument-color}{\lstinline{file/directory}} permissions.\\
\vspace{-0.1cm}
......
......@@ -702,7 +702,7 @@
\end{tikzpicture}
\end{pframe}
\subsection{Change directory shortcuts - refer to your home folder}
\subsection{Change directory shortcuts - refer to your home directory}
\begin{pframe}
\vspace{-0.5cm}
\begin{framed}
......@@ -940,7 +940,7 @@
\end{pframe}
\section{Manipulate Files and Folders}
\section{Manipulate Files and Directories}
\begin{pframe}
\textcolor{command-color}{\lstinline{mkdir}} \textcolor{option-color}{\lstinline{[option]..}} \textcolor{argument-color}{\lstinline{[directory]...}}\\
......@@ -964,11 +964,11 @@
\medskip
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-3.5cm,yshift=-6.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins-155808.pdf}};
\node[xshift=-3.5cm,yshift=-6.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins_alert.pdf}};
\end{tikzpicture}
\end{pframe}
\subsection{Create folders}
\subsection{Create directories}
\begin{pframe}
\vspace{-0.5cm}
\begin{framed}
......@@ -1521,7 +1521,7 @@
% \end{itemize}
%
% \begin{tikzpicture}[remember picture,overlay]
% \node[xshift=-3.5cm,yshift=-2.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins-155808.pdf}};
% \node[xshift=-3.5cm,yshift=-2.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins_alert.pdf}};
% \end{tikzpicture}
% \end{pframe}
%
......@@ -1930,12 +1930,13 @@
\lstinline{/usr/bin/zip}\vspace{-0.1cm}\\
\lstinline{/var/lib/dpkg/info/bzip2.list}\vspace{-0.2cm}\\
\lstinline{...}\\
\lstinline{$} \textcolor{command-color}{\lstinline{locate}} \textcolor{argument-color}{\lstinline{/usr/}}\textcolor{wildcard-color}{\lstinline{*}}\textcolor{argument-color}{\lstinline{/zip}}\vspace{-0.1cm}\\
\lstinline{$} \textcolor{command-color}{\lstinline{locate}} \textcolor{argument-color}{\lstinline{/usr/}}\textcolor{wildcard-color}{\lstinline{*}}\textcolor{argument-color}{\lstinline{zip}}\vspace{-0.1cm}\\
\lstinline{/usr/bin/zip}\vspace{-0.1cm}\\
\lstinline{/usr/bin/zipcloak}\vspace{-0.1cm}\\
\lstinline{/usr/bin/zipdetails}\vspace{-0.1cm}\\
\lstinline{/usr/bin/gpg-zip}\vspace{-0.1cm}\\
\lstinline{/usr/lib/klibc/bin/gzip}\vspace{-0.1cm}\\
\lstinline{...}}
\end{framed}
% \begin{minted}[frame=single,framesep=5pt,gobble=4,fontsize=\footnotesize]{console}
% $ locate zip
......@@ -1965,7 +1966,7 @@
\textbf{Example}: \\
Search for all files ending with '.fasta' in directory 'mascot' that where last modified more than 2 years ago:
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{find}} \textcolor{argument-color}{\lstinline{/nfs/mascot}} \textcolor{option-color}{\lstinline{-type f -name}} \textcolor{wildcard-color}{\lstinline{*}}\textcolor{argument-color}{\lstinline{.fasta}} \textcolor{option-color}{\lstinline{-mtime +730}}\vspace{-0.1cm}\\
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{find}} \textcolor{argument-color}{\lstinline{/nfs/mascot}} \textcolor{option-color}{\lstinline{-type f -name}} \textcolor{wildcard-color}{\lstinline{*}}\textcolor{option-color}{\lstinline{.fasta}} \textcolor{option-color}{\lstinline{-mtime +730}}\vspace{-0.1cm}\\
\lstinline{/nfs/mascot/sequence/Cdifile630/old/25374.C_difficile_6.fasta}\vspace{-0.1cm}\\
\lstinline{/nfs/mascot/sequence/S_GP_0808/current/GeneDB_Smansoni_P.fasta}\vspace{-0.1cm}\\
\lstinline{/nfs/mascot/sequence/S_GP_4.0h/old/GDB_Smansoni_P.v4.0h.fasta}}
......
\subsection*{Setup}
Make sure that you are connected to the \textbf{education server}.\\
Check the \textbf{connecting} practical session instructions for help.
Check the steps from the \textbf{connecting} practical session for help.
\medskip
\subsection*{Moving around}
\begin{itemize}
\item Check where you are now. (\textcolor{command-color}{\lstinline{pwd}})
\item Navigate to the \textbf{root} folder. (\textcolor{command-color}{\lstinline{cd}})
\item Print the \textbf{content} of the root folder. (\textcolor{command-color}{\lstinline{ls}})
\item Navigate to your \textbf{home} folder. (\textcolor{command-color}{\lstinline{cd}})
\item Check if the content of your home folder resembles the file tree structure from Figure~\ref{initial_tree} and mark (cross) on the paper any extra files/folder present in Figure~\ref{initial_tree}. (\textcolor{command-color}{\lstinline{ls}})
\item Check where you are now, i.e., the absolute path to your current (working) directory. (\textcolor{command-color}{\lstinline{pwd}})
\item Navigate to the \textbf{root} directory. (\textcolor{command-color}{\lstinline{cd}})
\item Print the \textbf{content} of the root directory. (\textcolor{command-color}{\lstinline{ls}})
\item Navigate to your \textbf{home} directory. (\textcolor{command-color}{\lstinline{cd}})
\item Check if the content of your \textbf{home} directory resembles the file tree structure from Figure~\ref{initial_tree} and mark (on the paper) any extra files/directories. (\textcolor{command-color}{\lstinline{ls}})
\end{itemize}
\begin{figure}[!h]
\centering
\includegraphics[width=\textwidth]{../images/core_practical_file_tree.pdf}
\caption{Initial home folder tree?}
\caption{Initial home directory tree?}
\label{initial_tree}
\end{figure}
\subsection*{Creating and working with directories and files}
Make sure that you are in your \textbf{home} folder. (\textcolor{command-color}{\lstinline{pwd, cd}})
Make sure that your \textbf{working} directory is your \textbf{home} directory. (\textcolor{command-color}{\lstinline{pwd, cd}})
Run a sequence of commands that will make your home folder tree look as in Figure~\ref{initial_tree_01}.
Run a sequence of commands to make your \textbf{home} directory tree look as in Figure~\ref{initial_tree_01}.
This will include:
\begin{itemize}
\item Rename the \textbf{project\_x} folder to \textbf{project\_genetics}. (\textcolor{command-color}{\lstinline{mv}})
\item Check that the renaming was performed. (\textcolor{command-color}{\lstinline{ls}})
\item Create three \textbf{new directories} named: ``\textbf{data}'', ``\textbf{src}'', ``\textbf{doc}''. (\textcolor{command-color}{\lstinline{mkdir}})
\item Move the \textbf{script.sh} file inside the \textbf{project\_genetics/src} folder. (\textcolor{command-color}{\lstinline{mv}})
\item Move all the \textbf{.gb} files inside the \textbf{data} directory. (\textcolor{command-color}{\lstinline{mv, *}})
\item Check that all \textbf{.gb} files were moved inside the \textbf{data} folder.
\item Make a copy of the \textbf{project\_genetics/README.md} inside the \textbf{project\_genetics/data} folder. (\textcolor{command-color}{\lstinline{cp}})
\item Rename the \textbf{project\_x} directory to \textbf{project\_genetics}. (\textcolor{command-color}{\lstinline{mv}})
% \item Check that the renaming was performed. (\textcolor{command-color}{\lstinline{ls}})
\item Create three \textbf{new directories} inside the ``\textbf{project genetics}'' named: ``\textbf{data}'', ``\textbf{src}'', ``\textbf{doc}''. (\textcolor{command-color}{\lstinline{mkdir}})
\item Move the \textbf{script.sh} file inside the \textbf{project\_genetics/src} directory. (\textcolor{command-color}{\lstinline{mv}})
\item Move all the \textbf{.gb} files from \textbf{project\_genetics} inside the \textbf{project\_genetics/data} directory. (\textcolor{command-color}{\lstinline{mv, *}})
\item Make a copy of the \textbf{project\_genetics/README.md} inside \textbf{project\_genetics/doc}. (\textcolor{command-color}{\lstinline{cp}})
\end{itemize}
\begin{figure}[!h]
\centering
\includegraphics[width=\textwidth]{../images/core_practical_file_tree_01.pdf}
\caption{Home folder version 1}
\caption{Home directory tree}
\label{initial_tree_01}
\end{figure}
......@@ -51,24 +50,38 @@ This will include:
\subsection*{Inspect, edit, and search}
\begin{itemize}
\item Print the content of \textbf{$\sim$/project\_genetics/README.md} file. (\textcolor{command-color}{\lstinline{cat}})
\item Open the \textbf{$\sim$/project\_genetics/README.md} and edit it with \textbf{nano} according to what it is mentioned inside it. (\textcolor{command-color}{\lstinline{nano, Ctrl-k, Ctrl-x, ...}})
\item Print again the content of \textbf{$\sim$/project\_genetics/README.md} file. (\textcolor{command-color}{\lstinline{cat}})
\item Inspect the content of \textbf{$\sim$/project\_genetics/data/orchids.gb} file. (\textcolor{command-color}{\lstinline{cat}})
\item Inspect the content of \textbf{$\sim$/project\_genetics/data/orchids.gb} file. (\textcolor{command-color}{\lstinline{less, q}})
\item Search for the appearences of \textbf{LOCUS} within the \textbf{$\sim$/project\_genetics/data/orchids.gb}. (\textcolor{command-color}{\lstinline{grep}})
\item Search for the appearences of \textbf{ORGANISM} within all \textbf{.gb} files in \textbf{$\sim$/project\_genetics/data}. (\textcolor{command-color}{\lstinline{grep, *}})
\item Open the \textbf{manual} page of \textbf{grep} and search there for the \textbf{option} on how to \textbf{suppress the prefixing of file names on output}. (\textcolor{command-color}{\lstinline{man, /}})
\item Utilize the previous \textbf{grep} command found \textbf{option} and utilize it in the search for the appearences of \textbf{ORGANISM} within the all \textbf{.gb} files in \textbf{$\sim$/project\_genetics/data}.
\item Rerun the previous command and redirect its output to a file named \textbf{organisms.txt} inside the \textbf{$\sim$/project\_genetics/data} folder. (\textcolor{command-color}{\lstinline{grep, *, >}})
\item Check the content of the newly \textbf{organisms.txt} created file. (\textcolor{command-color}{\lstinline{cat}})
\item Make sure that your current directory is \textbf{$\sim$/project\_genetics/data/}.\\
Run the \textbf{$\sim$/project\_genetics/src/script.sh} script.\\
A new file lost\_orchid.gb should appear now in the \textbf{$\sim$/project\_genetics/data/} directory.
\item Print the \textbf{project\_genetics/README.md} file contents. (\textcolor{command-color}{\lstinline{cat}})
\vspace{-0.1cm}
\item Open the \textbf{project\_genetics/README.md} file with \textcolor{command-color}{\lstinline{nano}} and edit it according to what it is mentioned inside it. (make use of key combinations in \textcolor{command-color}{\lstinline{nano}}, e.g., \textcolor{command-color}{\lstinline{Ctrl-k, Ctrl-x, ...}}; see cheat sheet)
\vspace{-0.6cm}
\item Print again the \textbf{project\_genetics/README.md} file content to check the changes. (\textcolor{command-color}{\lstinline{cat}})
\vspace{-0.1cm}
\item Inspect the \textbf{project\_genetics/data/orchids.gb} file content first with the \textcolor{command-color}{\lstinline{cat}} command and after that with the \textcolor{command-color}{\lstinline{less}} command in order to see the differences between the two commands.
\vspace{-0.1cm}
\item Search for the appearences of \textbf{LOCUS} within the \textbf{project\_genetics/data/orchids.gb}. (\textcolor{command-color}{\lstinline{grep}})
\vspace{-0.1cm}
\item Search for the appearences of \textbf{ORGANISM} within all the \textbf{.gb} files in the \textbf{project\_genetics/data} directory. (\textcolor{command-color}{\lstinline{grep, *}})
\vspace{-0.1cm}
\item Open the \textbf{manual} page of \textbf{grep} and search for the \textbf{option} on how to \textbf{suppress the prefixing of file names on output}. (\textcolor{command-color}{\lstinline{man}}; use the \textcolor{command-color}{\lstinline{/}} key to search for keywords inside the manual page)
\vspace{-0.1cm}
\item Make use of the previous \textbf{grep} command found \textbf{option} in the search for the appearences of \textbf{ORGANISM} within the all \textbf{.gb} files in \textbf{project\_genetics/data}.
\vspace{-0.1cm}
\item Rerun the previous command and redirect its output to a file named \textbf{organisms.txt} inside the \textbf{project\_genetics/data} directory. (\textcolor{command-color}{\lstinline{grep, *, >}})
\vspace{-0.1cm}
\item Check the content of the newly \textbf{organisms.txt} created file. (\textcolor{command-color}{\lstinline{cat}} or \textcolor{command-color}{\lstinline{less}})
\vspace{-0.1cm}
\item Make sure that your current directory is \textbf{project\_genetics/data} and run the \textbf{project\_genetics/src/script.sh} script.
A new file \textbf{lost\_orchid.gb} should appear now in the \textbf{project\_genetics/data} directory.
\vspace{-0.1cm}
\item Append the contents of \textbf{lost\_orchid.gb} to the \textbf{orchids.gb} file. (\textcolor{command-color}{\lstinline{cat, >>}})
\vspace{-0.1cm}
\item Remove the \textbf{lost\_orchid.gb} file. (\textcolor{command-color}{\lstinline{rm}})
\vspace{-0.1cm}
\item Print the first three organisms from the \textbf{organisms.txt}. (\textcolor{command-color}{\lstinline{head}})
\vspace{-0.1cm}
\item What is the total number of organisms that appear in the \textbf{organisms.txt} file? (\textcolor{command-color}{\lstinline{wc}})
\vspace{-0.1cm}
\item What is the disk usage of the data folder? (\textcolor{command-color}{\lstinline{du}})
\item Congratulations, you have finished the practical session.
\end{itemize}
Congratulations, you have finished this practical session!
\ No newline at end of file
......@@ -76,6 +76,12 @@
\end{center}
\end{pframe}
\begin{pframe}
\begin{center}
\includegraphics[width=0.95\textwidth]{../images/terminal_shell_overview_02.pdf}
\end{center}
\end{pframe}
\begin{pframe}
\begin{center}
\includegraphics[width=0.95\textwidth]{../images/terminal_shell_overview_01a.pdf}
......@@ -94,12 +100,49 @@
\end{center}
\end{pframe}
\subsection{Command prompt}
\begin{pframe}
\begin{center}
\includegraphics[width=0.95\textwidth]{../images/terminal_shell_overview_02.pdf}
\includegraphics[width=0.95\textwidth]{../images/command_prompt_00.pdf}
\end{center}
\end{pframe}
\begin{pframe}
\begin{center}
\includegraphics[width=0.95\textwidth]{../images/command_prompt_01.pdf}
\end{center}
\end{pframe}
\begin{pframe}
\begin{center}
\includegraphics[width=0.95\textwidth]{../images/command_prompt_02.pdf}
\end{center}
\end{pframe}
\begin{pframe}
We use here an empty prompt:
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{cd project_x}}} \\
\textcolor{cli-text}{\lstinline{$}}
\end{framed}
\end{pframe}
\subsection{Maneuvering}
\begin{pframe}
\begin{itemize}
\item Command completion help: \textcolor{blue}{\lstinline{TAB}} key.
\item Stop entering line: \textcolor{blue}{\lstinline{Ctrl-c}}, i.e., \textcolor{blue}{\lstinline{Ctrl}} and \textcolor{blue}{\lstinline{c}} keys.
\begin{itemize}
\item \textcolor{important-note}{Note that \lstinline{Ctrl-c} is not used for copy}.
\end{itemize}
\item Navigate the command line with \textcolor{blue}{$\leftarrow$} and \textcolor{blue}{$\rightarrow$} arrow keys.
\item Go to the command line start/end: \textcolor{blue}{\lstinline{HOME}} / \textcolor{blue}{\lstinline{END}} keys.
\item Navigate through history commands with \textcolor{blue}{$\uparrow$} and \textcolor{blue}{$\downarrow$} arrow keys.
\item Quit: \textcolor{blue}{\lstinline{Ctrl-d}}.
% \item Repeat last item from previous command: \textcolor{blue}{\lstinline{Alt-.}}
\end{itemize}
\end{pframe}
\section{The Filesystem}
\subsection{The manner in which storage is organized}
......@@ -379,22 +422,6 @@
% \bigskip
% \end{pframe}
\subsection{Maneuvering}
\begin{pframe}
\begin{itemize}
\item Command completion help: \textcolor{blue}{\lstinline{TAB}} key.
\item Stop entering line: \textcolor{blue}{\lstinline{Ctrl-c}}, i.e., \textcolor{blue}{\lstinline{Ctrl}} and \textcolor{blue}{\lstinline{c}} keys.
\begin{itemize}
\item \textcolor{important-note}{Note that \lstinline{Ctrl-c} is not used for copy}.
\end{itemize}
\item Navigate the command line with \textcolor{blue}{$\leftarrow$} and \textcolor{blue}{$\rightarrow$} arrow keys.
\item Go to the command line start/end: \textcolor{blue}{\lstinline{HOME}} / \textcolor{blue}{\lstinline{END}} keys.
\item Navigate through history commands with \textcolor{blue}{$\uparrow$} and \textcolor{blue}{$\downarrow$} arrow keys.
\item Quit : \textcolor{blue}{\lstinline{Ctrl-d}} key.
% \item Repeat last item from previous command: \textcolor{blue}{\lstinline{Alt-.}}
\end{itemize}
\end{pframe}
% \subsection{Standard wildcards}
% \begin{pframe}
%
......@@ -739,6 +766,52 @@
\end{tikzpicture}
\end{pframe}
\subsection{Some ls options}
\begin{pframe}
\begin{itemize}
\item \textcolor{option-color}{\lstinline{-l}} (long)\\
Long listing: type, permissions, owner, group, size, and date.
\item \textcolor{option-color}{\lstinline{-S}} (size)\\
Biggest files first.
\item \textcolor{option-color}{\lstinline{-h, --human-readable}}\\
With \textcolor{option-color}{\lstinline{-l}} and/or \textcolor{option-color}{\lstinline{-s}} prints human readable sizes.
\item \textcolor{option-color}{\lstinline{-r, --reverse}}\\
Reverses the sort order.
\item \textcolor{option-color}{\lstinline{-F, --classify}}\\
Append indicator type to entries, e.g, sufix '/' for directory.
\end{itemize}
\end{pframe}
\begin{pframe}
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{ls}} \textcolor{option-color}{\lstinline{-lSh}} \textcolor{argument-color}{\lstinline{/user/games/}}\\
\lstinline{-rwxr-xr-x 1 root root 276K nov 12}\textcolor{white}{\lstinline{ss}}\lstinline{2015}\textcolor{white}{\lstinline{s}}\lstinline{sol}\vspace{-0.1cm}\\
\lstinline{-rwxr-xr-x 1 root root 158K aug 25}\textcolor{white}{\lstinline{s}}\lstinline{08:54}\textcolor{white}{\lstinline{s}}\lstinline{gnome-sudoku}\vspace{-0.1cm}\\
\lstinline{-rwxr-xr-x 1 root root 109K feb 11}\textcolor{white}{\lstinline{ss}}\lstinline{2016}\textcolor{white}{\lstinline{s}}\lstinline{gnome-mines}\vspace{-0.1cm}\\
\lstinline{-rwxr-xr-x 1 root root 105K nov 12}\textcolor{white}{\lstinline{ss}}\lstinline{2015}\textcolor{white}{\lstinline{s}}\lstinline{gnome-mahjongg}\vspace{-0.1cm}\\
\lstinline{-rwxr-xr-x 1 root root 1,6K mei 16}\textcolor{white}{\lstinline{ss}}\lstinline{2015}\textcolor{white}{\lstinline{s}}\lstinline{espdiff}\vspace{-0.1cm}}
\end{framed}
\end{pframe}
\begin{pframe}
\begin{minted}[framesep=4pt,gobble=4,fontsize=\footnotesize]{text}
-rwxr-xr-x 1 root root 276K nov 12 2015 sol
-rwxr-xr-x 1 root root 158K aug 25 08:54 gnome-sudoku
-rwxr-xr-x 1 root root 109K feb 11 2016 gnome-mines
-rwxr-xr-x 1 root root 105K nov 12 2015 gnome-mahjongg
-rwxr-xr-x 1 root root 1,6K mei 16 2015 espdiff
---------- ---- ---- ---- ------------ --------------
| | | | | |
| | | | | +----- File Name
| | | | +------------------ Modification Time
| | | +----------------------- Size
| | +----------------------------- Group
| +--------------------------------- Owner
+---------------------------------------------- Type and Permissions
\end{minted}
\end{pframe}
\subsection{Change directory shortcuts - go to previous working directory}
\begin{pframe}
\vspace{-0.5cm}
......@@ -804,6 +877,27 @@
\end{tikzpicture}
\end{pframe}
\subsection{Change directory - no argument}
\begin{pframe}
\vspace{-0.5cm}
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{cd}}}
\end{framed}
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-6.4cm,yshift=-6.8cm] at (current page.north east) {\includegraphics[width=10.8cm]{../images/navigate_files_example_12.pdf}};
\end{tikzpicture}
\end{pframe}
\begin{pframe}
\vspace{-0.5cm}
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{cd}}\\
\textcolor{cli-text}{\lstinline{$}}}
\end{framed}
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-6.4cm,yshift=-6.8cm] at (current page.north east) {\includegraphics[width=10.8cm]{../images/navigate_files_example_11.pdf}};
\end{tikzpicture}
\end{pframe}
% \subsection{pwd}
......
......@@ -16,6 +16,7 @@
\begin{document}
\makeHeader
\vspace{-1cm}
\input{handouts_core1_content}
% Make it such that the first line of their file contains a name for the file to rename to.
......
......@@ -2,6 +2,7 @@
\begin{enumerate}
\item In Linux everything is stored as:
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item an apple
......@@ -12,38 +13,100 @@
\item none of the above
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item An absolute path is:
\vspace{-0.2cm}
\begin{enumerate}[label=(\alph*)]
\item The path to the root directory from the current (working) directory.
\item The path of a file system object (i.e., file, directory or link) relative to the root directory.
\item The path to an important file which is part of the Linux system.
\item The path of a file system object relative to the current (working) directory.
\end{enumerate}
\vspace{-0.2cm}
\item A shell is:
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item an oil and gas company
\item a command line interpreter
\item an animal's hard outer layer
\item a manipulation command
\item an animal's hard outer layer
\item an image viewer
\item none of the above
\end{enumerate}
\end{multicols}
\vspace{-0.2cm}
\item Which keys are used to navigate through the previously executed commands?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item Ctrl-u and Ctrl-d
\item Page Up and Page Down
\item Up and Down arrow keys
\item F1 and F2
\item Shift-u and Shift-d
\item None of the above
\end{enumerate}
\end{multicols}
\vspace{-0.2cm}
\item Which keys combination is generally used to exit from a terminal?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item Ctrl-c
\item Ctrl-d
\item Esc-Ctrl
\item Ctr-t
\item Ctrl-t
\item Alt-F1
\item Shift-Esc
\end{enumerate}
\end{multicols}
\vspace{-0.2cm}
\item What key is used to predict command input such as file names in path or commands?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item Ctrl-p
\item Alt-p
\item Shift-a
\item Alt-F1
\item Tab
\item None of the above
\end{enumerate}
\end{multicols}
\vspace{-0.1cm}
\item What commands can be used to list the detailed content (long listing format) of a directory named ``project\_x'', present in your working directory?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}
\item[[ ]] ls -d project\_x
\item[[ ]] ls -l Project\_x
\item[[ ]] pwd project\_x
\item[[ ]] ls -l project\_x/../project\_x
\item[[ ]] cd project\_x
\item[[ ]] ls -l project\_x/
\end{enumerate}
\end{multicols}
\vspace{-0.1cm}
\item Let's assume that the output of the ``\textcolor{command-color}{\lstinline{pwd}}'' command is ``/home/student23/project\_x''. When you execute the ``\textcolor{command-color}{\lstinline{cd}} \textcolor{argument-color}{\lstinline{..}}'' command your absolute path is?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item /home/student32
\item /student23/project\_x
\item /
\item /home/student23
\item /home/student23/project\_x/..
\item none of the above
\end{enumerate}
\end{multicols}
\end{enumerate}
\subsection*{Moving around}
......@@ -66,6 +129,7 @@ Make sure that you are connected to the \textbf{education server}.
\item Navigate to the \textbf{root} directory, i.e., change your working directory to be the root directory.
\item Print the \textbf{content} of the root directory.
\item Navigate to your \textbf{home} directory.
\item Navigate through the previously executed commands. Repeat steps 3 to 5 by not manually retyping the commands but by using the history.
\item How many files and directories are in your \textbf{home} directory? \\
\item Check if the content of your \textbf{home} directory resembles the file tree structure from Figure~\ref{initial_tree} and indicate on the paper the extra files/directories. Make sure you use the auto-completion option.
\end{enumerate}
......@@ -82,7 +146,6 @@ Make sure that you are connected to the \textbf{education server}.
\item Assuming your current working directory is \textbf{project\_x}, what command could you issue to change your working directory to \textbf{unimportant}?\\
\item What is the \textbf{lost\_orchid} file absolute path? \\
\item Can you get an estimation on how many users have an account on this machine? \\
\item Navigate through the previously executed commands.
\end{enumerate}
Congratulations, you have finished this practical session!
\ No newline at end of file
......@@ -80,7 +80,7 @@
\medskip
\begin{tikzpicture}[remember picture,overlay]
\node[xshift=-3.5cm,yshift=-6.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins-155808.pdf}};
\node[xshift=-3.5cm,yshift=-6.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins_alert.pdf}};
\end{tikzpicture}
\end{pframe}
......@@ -637,7 +637,7 @@
% \end{itemize}
%
% \begin{tikzpicture}[remember picture,overlay]
% \node[xshift=-3.5cm,yshift=-2.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins-155808.pdf}};
% \node[xshift=-3.5cm,yshift=-2.5cm] at (current page.north east) {\includegraphics[width=2.5cm]{../images/penguins_alert.pdf}};
% \end{tikzpicture}
% \end{pframe}
%
......@@ -785,68 +785,68 @@
\end{pframe}
% \subsection{cat}
% \begin{pframe}
% \textcolor{command-color}{\lstinline{cat}} \textcolor{option-color}{\lstinline{[option]...}} \textcolor{argument-color}{\lstinline{[file]...}}
% \medskip
%
% View the entire content of the input \textcolor{argument-color}{\lstinline{files}}.
% \medskip
%
% \begin{framed}
% \textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{cat}} \textcolor{argument-color}{\lstinline{/etc/passwd}}\vspace{-0.1cm}\\
% \lstinline{root:x:0:0:root:/root:/bin/bash}\vspace{-0.1cm}\\
% \lstinline{daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{bin:x:2:2:bin:/bin:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{sys:x:3:3:sys:/dev:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{sync:x:4:65534:sync:/bin:/bin/sync}\vspace{-0.1cm}\\
% \lstinline{...}}
% \end{framed}
% % \begin{minted}[frame=single,framesep=5pt,gobble=4,fontsize=\footnotesize]{console}
% % $ cat /etc/passwd
% % root:x:0:0:root:/root:/bin/bash
% % daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
% % bin:x:2:2:bin:/bin:/usr/sbin/nologin
% % sys:x:3:3:sys:/dev:/usr/sbin/nologin
% % sync:x:4:65534:sync:/bin:/bin/sync
% % ...
% % \end{minted}
% \end{pframe}
\subsection{cat}
\begin{pframe}
\textcolor{command-color}{\lstinline{cat}} \textcolor{option-color}{\lstinline{[option]...}} \textcolor{argument-color}{\lstinline{[file]...}}
\medskip
% \subsection{less}
% \begin{pframe}
% \textcolor{command-color}{\lstinline{less}} \textcolor{argument-color}{\lstinline{[file]...}}
% \medskip
%
% View the \textcolor{argument-color}{\lstinline{file}} with scrolling allowed.\\
% Press \textcolor{option-color}{\lstinline{h}} to get help and \textcolor{option-color}{\lstinline{q}} to exit.
% \medskip
%
% \begin{framed}
% \textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{less}} \textcolor{argument-color}{\lstinline{/etc/passwd}}}
% \end{framed}
% \vspace{-0.6cm}
%
% \begin{framed}
% \textcolor{cli-text}{\lstinline{root:x:0:0:root:/root:/bin/bash}\vspace{-0.1cm}\\
% \lstinline{daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{bin:x:2:2:bin:/bin:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{sys:x:3:3:sys:/dev:/usr/sbin/nologin}\vspace{-0.1cm}\\
% \lstinline{sync:x:4:65534:sync:/bin:/bin/sync}\vspace{-0.1cm}\\
% \lstinline{...}}
% \end{framed}
% % \begin{minted}[frame=single,framesep=5pt,gobble=4,fontsize=\footnotesize]{console}
% % $ less /etc/passwd
% % \end{minted}
% % \begin{minted}[frame=single,framesep=5pt,gobble=4,fontsize=\footnotesize]{console}
% % root:x:0:0:root:/root:/bin/bash
% % daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
% % bin:x:2:2:bin:/bin:/usr/sbin/nologin
% % sys:x:3:3:sys:/dev:/usr/sbin/nologin
% % sync:x:4:65534:sync:/bin:/bin/sync
% % ...
% % \end{minted}
% \end{pframe}
View the entire content of the input \textcolor{argument-color}{\lstinline{files}}.
\medskip
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{cat}} \textcolor{argument-color}{\lstinline{/etc/passwd}}\vspace{-0.1cm}\\
\lstinline{root:x:0:0:root:/root:/bin/bash}\vspace{-0.1cm}\\
\lstinline{daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin}\vspace{-0.1cm}\\
\lstinline{bin:x:2:2:bin:/bin:/usr/sbin/nologin}\vspace{-0.1cm}\\
\lstinline{sys:x:3:3:sys:/dev:/usr/sbin/nologin}\vspace{-0.1cm}\\
\lstinline{sync:x:4:65534:sync:/bin:/bin/sync}\vspace{-0.1cm}\\
\lstinline{...}}
\end{framed}
% \begin{minted}[frame=single,framesep=5pt,gobble=4,fontsize=\footnotesize]{console}
% $ cat /etc/passwd
% root:x:0:0:root:/root:/bin/bash
% daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
% bin:x:2:2:bin:/bin:/usr/sbin/nologin
% sys:x:3:3:sys:/dev:/usr/sbin/nologin
% sync:x:4:65534:sync:/bin:/bin/sync
% ...
% \end{minted}
\end{pframe}
\subsection{less}
\begin{pframe}
\textcolor{command-color}{\lstinline{less}} \textcolor{argument-color}{\lstinline{[file]...}}
\medskip
View the \textcolor{argument-color}{\lstinline{file}} with scrolling allowed.\\
Press \textcolor{option-color}{\lstinline{h}} to get help, \textcolor{option-color}{\lstinline{q}} to exit, and \textcolor{option-color}{\lstinline{/}} followed by text to search.
\medskip
\begin{framed}
\textcolor{cli-text}{\lstinline{$} \textcolor{command-color}{\lstinline{less}} \textcolor{argument-color}{\lstinline{/etc/passwd}}}
\end{framed}
\vspace{-0.6cm}