Commit 67771b76 authored by Mihai's avatar Mihai

Split handhouts and create booklet.

parent 8c1c9680
\documentclass{article}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{../shared/handouts}
\input{../shared/shared}
\usepackage[utf8]{inputenc}
\pagenumbering{arabic}
\newcommand\cleartooddpage{\clearpage
\ifodd\value{page}\else\null\clearpage\fi}
\begin{document}
\vspace*{3cm}
\begin{center}
{\Huge Practical Linux}
\end{center}
\vspace{4cm}
\begin{center}
\includegraphics[width=0.6\textwidth]{../images/tux_computer_work.pdf}
\bigskip
\end{center}
\cleartooddpage
\pagestyle{plain}
\vspace{5cm}
Welcome to the \textbf{Practical Linux} course!
\medskip
Designed for researchers, including PhD students and postdocs, this course
provides attendees with an introduction to the Linux operating system. Linux
powers more than 90\% of the world’s supercomputers, most internet servers,
and more than a billion Android devices. Additionally, bioinformatics depends
heavily on Linux since a lot of scientific software is written specifically
for it.
\medskip
This short and concise hands-on course will teach you how to effectively use
Linux using the command line interface. You will be able to swiftly start using
Linux both on a server, e.g., the LUMC Shark cluster, as well as on your personal
computer.
\medskip
Learning outcomes:
\vspace{-0.2cm}
\begin{itemize}
\item Understand and navigate through the filesystem structure.
\vspace{-0.2cm}
\item Obtain information about files and directories.
\vspace{-0.2cm}
\item Manipulate, i.e., create, delete, move, and rename files and directories.
\vspace{-0.2cm}
\item Inspect and edit files content.
\vspace{-0.2cm}
\item Gather disk storage information.
\vspace{-0.2cm}
\item Search for and within files.
\vspace{-0.2cm}
\item Manage file and directory access permissions.
\vspace{-0.2cm}
\item Connect to other computers.
\end{itemize}
The entire course material is available online at the following address:\\
\url{https://git.lumc.nl/courses/practical-linux-course}
\subsection*{Important}
In the following pages you will find the practical handouts for this course.
The provided credentials should be used during the practicals to connect to
the remote machine. In order to log in to the machines present in this room
utilize your LUMC account. To log in to the provided laptops use the account
information present on them. Please note that the last part of this booklet
consists of a command cheat sheet which could be of great help during the
practicals.
\clearpage
\begin{center}
{\bf Practical 1}\\
\medskip
Connecting to Other Machines
\end{center}
\bigskip
\input{../connecting/handouts_connecting_content}
\clearpage
\begin{center}
{\bf Practical 2}\\
\medskip
Core
\end{center}
\bigskip
\input{../core/handouts_core_content}
\clearpage
\begin{center}
{\bf Practical 3}\\
\medskip
User Environment
\end{center}
\bigskip
\input{../user_environment/handouts_user_environment_content}
\cleartooddpage
\begin{center}
{\bf Commands Cheat Sheet}\\
\end{center}
\bigskip
\input{../core/commands_cheatsheet_content}
\end{document}
......@@ -10,39 +10,7 @@
\begin{document}
\makeHeader
\subsection*{Setup}
Open \url{http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html} in your browser.
\medskip
Download the \textbf{32-bit} version of \href{https://the.earth.li/~sgtatham/putty/latest/w32/putty.exe}{\textbf{putty.exe}. \\
(Alternative binary files, the SSH and Telnet client itself)}.
\medskip
\subsection*{Connect to the education server}
Run the downloaded \textbf{putty.exe} executable.
\medskip
Introduce the education server IP address \textbf{145.88.35.11} as destination.
\medskip
Make sure that the \textbf{port number} is set to \textbf{22} and that \textbf{SSH} is selected as \textbf{connection type}.
\medskip
Start the connection. Press ``Yes'' if the security alert pops in.
\medskip
Introduce your provided \textbf{username} and press enter.
\medskip
Introduce your provided \textbf{password} and press enter.
\medskip
You should now be connected to the education server.
\medskip
\input{handouts_connecting_content}
\end{document}
\subsection*{Setup}
Open \url{http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html} in your browser.
\medskip
Download the \textbf{32-bit} version of \href{https://the.earth.li/~sgtatham/putty/latest/w32/putty.exe}{\textbf{putty.exe}. \\
(Alternative binary files, the SSH and Telnet client itself)}.
\medskip
\subsection*{Connect to the education server}
Run the downloaded \textbf{putty.exe} executable.
\medskip
Introduce the education server IP address \textbf{145.88.35.11} as destination.
\medskip
Make sure that the \textbf{port number} is set to \textbf{22} and that \textbf{SSH} is selected as \textbf{connection type}.
\medskip
Start the connection. Press ``Yes'' if the security alert pops in.
\medskip
Introduce your provided \textbf{username} and press enter.
\medskip
Introduce your provided \textbf{password} and press enter.
\medskip
You should now be connected to the education server.
\medskip
This diff is collapsed.
This diff is collapsed.
\documentclass{article}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\providecommand{\handoutsTitle }{\vspace{0.5cm}Practical 2 \\ \vspace{0.5cm}Core}
\usepackage{../shared/handouts}
\input{../shared/shared}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\input{../shared/shared}
\definecolor{options-color}{rgb}{0.11,0.27,0.7}
\definecolor{command-color}{rgb}{0.22,0.22,0.45}
\begin{document}
\makeHeader
\subsection*{Setup}
Make sure that you are connected to the \textbf{education server}.\\
Check the \textbf{connecting} practical session instructions 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 List the content of the \textbf{working (current) directory}. (\textcolor{command-color}{\lstinline{ls}})
\item Go \textbf{up a directory}, \textbf{list} the content, and then \textbf{go back} to your \textbf{home} folder. (\textcolor{command-color}{\lstinline{cd, ls}})
\end{itemize}
\subsection*{Creating and working with directories and files}
\begin{itemize}
\item Make sure that you are in your \textbf{home} folder. (\textcolor{command-color}{\lstinline{pwd, cd}})
\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 Change the working directory to \textbf{$\sim$/project\_genetics}. (\textcolor{command-color}{\lstinline{cd}})
\item List the content of the \textbf{working (current) directory}. (\textcolor{command-color}{\lstinline{ls}})
\item Create three \textbf{new directories} named: \textbf{data}, \textbf{src}, \textbf{doc}. (\textcolor{command-color}{\lstinline{mkdir}})\\
Note that these new folders should be created under the \textbf{$\sim$/project\_genetics} folder.
\item Check that the new folders are there. (\textcolor{command-color}{\lstinline{ls}})
\item Move the \textbf{$\sim$/project\_genetics/script.sh} file inside the \textbf{$\sim$/project\_genetics/src} folder. (\textcolor{command-color}{\lstinline{mv}})
\item Check that the \textbf{script.sh} file was moved.
\item Move all the \textbf{.gb} files inside the \textbf{data} directory. (\textcolor{command-color}{\lstinline{mv, *}})\\
Note that the \textbf{.gb} files should be moved inside the \textbf{$\sim$/project\_genetics/data} folder.
\item Check that all \textbf{.gb} files were moved inside the \textbf{data} folder.
\item Make a copy of the \textbf{$\sim$/project\_genetics/README.md} file inside the \textbf{$\sim$/project\_genetics/data} folder. (\textcolor{command-color}{\lstinline{cp}})
\item List the content of the \textbf{$\sim$/project\_genetics/uninportant} directory. (\textcolor{command-color}{\lstinline{ls}})
\item Remove the \textbf{$\sim$/project\_genetics/uninportant} directory and turn the page. (\textcolor{command-color}{\lstinline{rm, hand}})
\end{itemize}
\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 Append the contents of \textbf{lost\_orchid.gb} to the \textbf{orchids.gb} file. (\textcolor{command-color}{\lstinline{cat, >>}})
\item Remove the \textbf{lost\_orchid.gb} file. (\textcolor{command-color}{\lstinline{rm}})
\item Print the first three organisms from the \textbf{organisms.txt}. (\textcolor{command-color}{\lstinline{head}})
\item What is the total number of organisms that appear in the \textbf{organisms.txt} file? (\textcolor{command-color}{\lstinline{wc}})
\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}
\input{handouts_core_content}
% Make it such that the first line of their file contains a name for the file to rename to.
% Ask them to rename that file.
......@@ -88,8 +25,5 @@ Check the \textbf{connecting} practical session instructions for help.
% They should also edit some files based on some other strings.
% Maybe also edit some scripts which later they will run to get some real thing. :)
\end{document}
\subsection*{Setup}
Make sure that you are connected to the \textbf{education server}.\\
Check the \textbf{connecting} practical session instructions 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}})
\end{itemize}
\begin{figure}[!h]
\centering
\includegraphics[width=\textwidth]{../images/core_practical_file_tree.pdf}
\caption{Initial home folder 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}})
Run a sequence of commands that will make your home folder 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}})
\end{itemize}
\begin{figure}[!h]
\centering
\includegraphics[width=\textwidth]{../images/core_practical_file_tree_01.pdf}
\caption{Home folder version 1}
\label{initial_tree_01}
\end{figure}
Remove the \textbf{project\_genetics/uninportant} directory. (\textcolor{command-color}{\lstinline{rm}})
\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 Append the contents of \textbf{lost\_orchid.gb} to the \textbf{orchids.gb} file. (\textcolor{command-color}{\lstinline{cat, >>}})
\item Remove the \textbf{lost\_orchid.gb} file. (\textcolor{command-color}{\lstinline{rm}})
\item Print the first three organisms from the \textbf{organisms.txt}. (\textcolor{command-color}{\lstinline{head}})
\item What is the total number of organisms that appear in the \textbf{organisms.txt} file? (\textcolor{command-color}{\lstinline{wc}})
\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}
This diff is collapsed.
......@@ -5,3 +5,21 @@
Michel Villerius\\
Jeroen Laros\\
}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{cblack}{rgb}{0,0,0}
\definecolor{cwhite}{rgb}{1,1,1}
\definecolor{command-color}{rgb}{0,0.5,0}
\definecolor{option-color}{rgb}{0.9,0.2,0.11}
\definecolor{argument-color}{rgb}{0.11,0.27,0.7}
\definecolor{pattern-color}{rgb}{0,0.5,0.5}
\definecolor{wildcard-color}{rgb}{0.75,0.3,0}
\definecolor{cli-text}{rgb}{0.15,0.15,0.15}
\definecolor{important-note}{rgb}{0.69,0.13,0.13}
\definecolor{redirection}{rgb}{0.99,0.13,0.13}
\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}
\definecolor{one-dot}{rgb}{0.9,0.2,0.0}
\definecolor{two-dots}{rgb}{0.11,0.11,0.8}
\definecolor{slash}{rgb}{0.3,0.3,0.3}
......@@ -9,70 +9,10 @@
\usepackage{../shared/handouts}
\input{../shared/shared}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{options-color}{rgb}{0.11,0.27,0.7}
\definecolor{command-color}{rgb}{0.22,0.22,0.45}
\begin{document}
\makeHeader
\section*{Exercises}
\subsection*{Setup}
Navigate to to the \lstinline{permissions} folder.
\subsection*{Users and permissions}
Inspect the ownership and permissions of the files using the \lstinline{ls}
command:
\begin{itemize}
\item Which user owns these files?
\item Which group owns these files?
\item What are the permissions for the user, the group and everyone else?
\end{itemize}
\subsection*{Changing permissions}
Change the permissions of the files using the \lstinline{chmod} command:
\begin{itemize}
\item Can you set the file named \lstinline{user} to be readable and
writeable for only you?
\item Can you make the file named \lstinline{group} readable for everyone in
the \lstinline{students} group, but not for anyone else?
\item Can you make the file \lstinline{other} writeable for everyone?
\end{itemize}
\subsection*{Executable files}
Can you make the file named \lstinline{program} executable?
\medskip
What does the program do when you execute it?
\subsection*{Directory permissions}
Ask your neighbour to list the content of your folder.
\medskip
Can you remove the permission to list the content?
\medskip
Can your neighbour still execute the program?
\medskip
Can you now remove all access to this folder for your neighbour?
\subsection*{Solutions}
If you have done all of the above as intended, your directory listing should
look similar to this:
\begin{lstlisting}[language=bash]
drwx------ 2 student01 students 4096 Mar 7 21:06 .
drwxr-xr-x 5 student01 students 4096 Mar 7 21:11 ..
-rw-r----- 1 student01 students 59 Mar 7 20:48 group
-rw-rw-rw- 1 student01 students 41 Mar 7 21:06 other
-rwxr-xr-x 1 student01 students 31 Mar 7 20:47 program
-rw------- 1 student01 students 48 Mar 7 20:49 user
\end{lstlisting}
% 145.88.35.11
% student42 1LoveLinux@LUMC!
\input{handouts_user_environment_content}
\end{document}
\section*{Exercises}
\subsection*{Setup}
Navigate to to the \lstinline{permissions} folder.
\subsection*{Users and permissions}
Inspect the ownership and permissions of the files using the \lstinline{ls}
command:
\begin{itemize}
\item Which user owns these files?
\item Which group owns these files?
\item What are the permissions for the user, the group and everyone else?
\end{itemize}
\subsection*{Changing permissions}
Change the permissions of the files using the \lstinline{chmod} command:
\begin{itemize}
\item Can you set the file named \lstinline{user} to be readable and
writeable for only you?
\item Can you make the file named \lstinline{group} readable for everyone in
the \lstinline{students} group, but not for anyone else?
\item Can you make the file \lstinline{other} writeable for everyone?
\end{itemize}
\subsection*{Executable files}
Can you make the file named \lstinline{program} executable?
\medskip
What does the program do when you execute it?
\subsection*{Directory permissions}
Ask your neighbour to list the content of your folder.
\medskip
Can you remove the permission to list the content?
\medskip
Can your neighbour still execute the program?
\medskip
Can you now remove all access to this folder for your neighbour?
\subsection*{Solutions}
If you have done all of the above as intended, your directory listing should
look similar to this:
\begin{lstlisting}[language=bash]
drwx------ 2 student01 students 4096 Mar 7 21:06 .
drwxr-xr-x 5 student01 students 4096 Mar 7 21:11 ..
-rw-r----- 1 student01 students 59 Mar 7 20:48 group
-rw-rw-rw- 1 student01 students 41 Mar 7 21:06 other
-rwxr-xr-x 1 student01 students 31 Mar 7 20:47 program
-rw------- 1 student01 students 48 Mar 7 20:49 user
\end{lstlisting}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment