\item[\alert{lp -h miller \textless path\textgreater}] sends the file to the pool printer
\item ideally a \texttt{.txt} or \texttt{.pdf} file\\[0.5cm]
\end{description}
\textbf{Checking the print status}
\begin{itemize}
\item Web interface: \structure{\url{http://miller:631/jobs}}
\item Favorable price tag per page: only 0 Euro
\item Quota: 30 pages every week per user
\end{itemize}
\end{frame}
\begin{frame}{Let's just take the file and move it to last}
\textbf{Moving files via the network to other computers - rsync}
\begin{description}
\item[\alert{rsync \textless source\textgreater \hspace{1pt}\textless target\textgreater}] copies the file from the source to the target
\item[\alert{rsync hi.txt hfischer@last.cl.uni-heidelberg.de:\textasciitilde /briefe/}] copies \texttt{hi.txt} from the local working directory to the folder \texttt{briefe} in the home directory of the user \texttt{hfischer} on last
\end{description}
\end{frame}
\begin{frame}{Linux Manual Pages}
\textbf{Help for commands - \structure{man} (\structure{man}ual pager utils)}
\begin{description}
\item[\alert{man \textless command\textgreater}] shows manual page for the specified command
\end{description}
\smaller
\textbf{Examples:}\\
\alert{man man} How, why and whatfore do you use \texttt{man}?
\medskip
\normalsize
If you are still kind of scared by the terminal, have a look at \url{https://linux.die.net/man/} or use a search engine of your choice.
Reminder: file extensions are irrelevant to the system
\end{frame}
\begin{frame}{More useful commands}
\begin{description}
\item[\alert{grep}] Searching the content of files
\item[\alert{find}] Searching files (i.e. by name)
\item[\alert{less}] View text file in pager, incl. search functionality
\item[\alert{head}] Printing the first few lines of a file
\item[\alert{tail}] Printing the last few lines of a file
\end{description}
Great sources for more information on a command are (besides \alert{man})
webpages like \href{https://wiki.ubuntuusers.de}{\texttt{wiki.ubuntuusers.de}} or \href{https://www.cyberciti.biz/faq}{\texttt{www.cyberciti.biz/faq}}.
\end{frame}
\subsection{Working with others and over the network}
\begin{frame}{Networks and their users}
\textbf{Computers in the network}
\begin{itemize}
\item{every computer is in the network}
\item{every user can log on to every computer}
\item{every user gets to use the same data}
\item{every user gets to use the same resources}
\end{itemize}
\textbf{Users and groups}
\begin{itemize}
\item each user has its own username and is at least in one group (students/mitarb)
\item e.g.: \alert{schubert} in \alert{students}
\item you can list all groups of a user with the \alert{groups} command
\end{itemize}
\end{frame}
\begin{frame}{Access Rights I}
The UNIX abbreviation for the three access rights:
\begin{description}[r]
\item[\alert{r}]read permission. The permission to read the file’s/folder’s content
\item[\alert{w}]write permission: The permission to change/delete the file/folder
\item[\alert{x}]execution permission (eXecute): The permission to execute the file as a program
\end{description}
\vspace{1.5em}
And for the classes of user and group management:
\begin{description}[r]
\item[\alert{u}] The user who owns the file
\item[\alert{g}] The users who are in the group which owns the file
\item[\alert{o}] Every other user
\end{description}
\end{frame}
\begin{frame}{Access Rights II}
How the access rights for a specific file or folder are set can be checked with \alert{ls -l \textless path\textgreater}.
\\[.5cm]
Two typical entries could look like this:\\
{\color{red}\texttt{ uuugggooo\\}}
\texttt{drwxrwxrwx 160 moser students 5440 Oct 21 21:25 topics\\
-rw-r----- 145 moser students 2670 Mar 18 13:12 cheat}
\\[.5cm]
The first entry is a directory which the user, group und others are able to read, write and execute.
The second entry is not a directory, but a file. The user is allowed to read and write the files, the group may only read the file. Others are not allowed to do anything.
\end{frame}
\begin{frame}{Access Rights III}
\textbf{Changing access rights - \structure{chmod} (\structure{ch}ange \structure{mod}e)}
\begin{description}[Hi] % Das Hi definiert nur, dass die Einrückung zwei Zeichen weit sein soll
\item[\alert{chmod \textless class(es)\textgreater\textbf{+}\textless permissions\textgreater \hspace{1pt} \textless file\textgreater}]\hspace{10cm} Allocates the given rights to the given class
\item[\alert{chmod \textless class(es)\textgreater \textbf{-}\textless permissions\textgreater \hspace{1pt} \textless file\textgreater}]\hspace{10cm} Withdraws the given rights from the given classes
\end{description}
\smaller
\textbf{Examples:}\\
\alert{chmod go-rwx \textless file\textgreater} withdraws the rights to read, write and execute from the users in the group and all others. \\
\alert{chmod u+w \textless file\textgreater} allocates write access to the user\\
\alert{chmod a-w \textless file\textgreater} withdraws the write access from everyone (= \alert{chmod ugo-w})
\normalsize
\textit{file} can always also be a \textit{directory}
\end{frame}
\begin{frame}{Experimenting with Linux and solving the pool test}
\begin{frame}{Experimenting with Linux and solving the pool test}
\begin{itemize}
\item Allows you to safely play around with a Linux terminal and practice commands.
\item There are some practice tasks in the style of the tasks that are asked in the pool test.
\item Because the Linux environment is simulated only in the browser not all programs are available. In particular, there is no \texttt{nano}, \texttt{vim} or \texttt{emacs}.
\begin{itemize}
\item If a text editor is necessary, one can use \texttt{vi}. The same keyboard shortcuts apply here as with \texttt{vim}, so especially the complicated methodology for closing the editor: \keys{ESC} + \texttt{:wq} to save and \keys{ESC} + \texttt{:q!} to discard the changes.
\item You do not always need an editor to fill a text file.
\item[\alert{mv -i file1 file2}] benennt die Datei \texttt{file1} in \texttt{file2} um (bestätigen mit \keys{Y})
\item[\alert{mv -i pfad1/file pfad2/file}] verschiebt die Datei
\end{description}
Wenn ihr \alert{-i} weglasst, werden Dateien ggfs. ohne Rückfrage überschrieben. Überschriebene Dateien sind \textbf{\textcolor{cwarning}{weg}}!\\[0.5cm]
\end{frame}
\begin{frame}{Dateiverwaltung II}
\textbf{Dateien löschen - rm (\structure{r}e\structure{m}ove files or directories)}
\begin{description}
\item[\alert{rm -i \textless Datei\textgreater}] löscht eine Datei
\item[\alert{rm -i -r \textless Verzeichnis\textgreater}] löscht ein ganzes Verzeichnis mit Inhalt und Unterordnern
\end{description}
Mit \alert{rm} entfernte Dateien sind auch \textbf{\textcolor{cwarning}{weg}}! (nicht im Papierkorb)
Und wenn ihr \alert{-i} weglasst, gibt es noch nicht mal eine Rückfrage...
\end{frame}
\begin{frame}{Textdateien anschauen und anlegen}
\textbf{Textdateien betrachten - \structure{cat}}
\begin{description}
\item[\alert{cat \textless Dateiname\textgreater}] schreibt den Inhalt einer Textdatei ins Terminal
% \item[\alert{/}] sucht einen Begriff $\rightarrow$ \structure{n} zeigt nächstes Suchergebnis
% \item[\alert{q}] beendet die Leseansicht\\[0.5cm]
\item[\alert{rsync \textless Quelle\textgreater\ \textless Ziel\textgreater}] kopiert die Datei von der Quelle ans Ziel
\item[\alert{rsync hi.txt hfischer@last.cl.uni-heidelberg.de:\textasciitilde /briefe/}] kopiert die Datei \texttt{hi.txt} aus dem lokalen Working Directory auf den Server last in das Home-Verzeichnis des Nutzers in den Unterordner \texttt{briefe}
\end{description}
\end{frame}
\begin{frame}{Linux Manual Pages}
\textbf{Hilfe zu Befehlen - \structure{man} (\structure{man}ual pager utils)}
\begin{description}
\item[\alert{man \textless Befehl\textgreater}]zeigt die Man-Page zum angegebenen Befehl
\end{description}
\smaller
\textbf{Beispiel:}\\
\alert{man man} Wie, wozu und weshalb nutze ich eigentlich \texttt{man}?
\medskip
\normalsize
Wem die Konsole noch zu unheimlich ist, dem sei \url{https://linux.die.net/man/} ans Herz gelegt, oder ihr benutzt eine Suchmaschine.
\end{frame}
\begin{frame}{Wildcards}
\textbf{Der Asterisk}
\begin{itemize}
\item erfasst mehrere Dateien gleichzeitig
\item ersetzt beliebig viele Zeichen (auch null)\\[0.5cm]
\end{itemize}
\textbf{Beispiel: \structure{rm *.txt}}\\
\begin{itemize}
\item\texttt{lel.txt} - wird gelöscht
\item\texttt{lel.pdf} - wird nicht gelöscht
\item\texttt{asd.txt} - wird gelöscht
\item\texttt{lel.pdf.txt} - wird gelöscht
\end{itemize}
Erinnerung: Dateiendungen sind für den User, nicht für das System!
\end{frame}
\begin{frame}{Weitere nützliche Befehle}
\begin{description}
\item[\alert{grep}] Im Inhalt von Dateien suchen
\item[\alert{find}] Dateien suchen (z.B. nach Namen)
\item[\alert{less}] Textdatei in einem Pager ansehen, inklusive Suchfunktion
\item[\alert{head}] Die ersten paar Zeilen einer Datei ausgeben
\item[\alert{tail}] Die letzten paar Zeilen einer Datei ausgeben
\end{description}
Gute Quellen für mehr Informationen zu einem Befehl sind neben \alert{man}
Websites wie \href{https://wiki.ubuntuusers.de}{\texttt{wiki.ubuntuusers.de}} oder \href{https://www.cyberciti.biz/faq}{\texttt{www.cyberciti.biz/faq}}.
\end{frame}
\subsection{Arbeiten im Netzwerk und mit Anderen}
\begin{frame}{Netzwerke und ihre Benutzer}
\textbf{Rechner im Netzwerk}
\begin{itemize}
\item{alle Rechner sind im Netz}
\item{alle User können auf viele Rechner}
\item{allen Usern stehen dieselben Daten zur Verfügung}
\item{allen Usern stehen dieselben Resourcen zur Verfügung}
\end{itemize}
\textbf{User und Gruppen}
\begin{itemize}
\item jeder User hat einen Usernamen und mind. eine Gruppe (students/mitarb)
\item z.B.: \alert{schubert} in \alert{students}
\item alle Gruppen kann man mit dem \alert{groups} Befehl auflisten
\end{itemize}
\end{frame}
\begin{frame}{Zugriffsrechte I}
Die UNIX-Kürzel für drei Zugriffstypen:
\begin{description}[r]
\item[\alert{r}]Leserechte. Erlaubnis, die Datei zu lesen bzw. den Verzeichnisinhalt einzusehen
\item[\alert{w}]Schreibrechte: Erlaubnis, die Datei zu verändern oder gar zu löschen
\item[\alert{x}]Ausführrechte (eXecute): Erlaubnis, die Datei als Programm auszuführen
\end{description}
\vspace{1.5em}
Und für die Klassen der User- und Gruppenverwaltung:
\begin{description}[r]
\item[\alert{u}]Der User, dem die Datei gehört
\item[\alert{g}]Die User, die in der Gruppe sind, der die Datei gehört
\item[\alert{o}]Alle anderen User des Systems
\end{description}
\end{frame}
\begin{frame}{Zugriffsrechte II}
Welche Zugriffsrechte nun für eine Datei oder ein Verzeichnis gesetzt sind, sieht man mit \alert{ls -l \textless Pfad\textgreater}.
\\[.5cm]
Zwei typische Einträge könnten so aussehen:\\
{\color{cwarning}\texttt{ uuugggooo\\}}
\texttt{drwxrwxrwx 160 moser students 5440 Oct 21 21:25 topics\\
-rw-r----- 145 moser students 2670 Mar 18 13:12 cheat}
\\[.5cm]
Die erste Datei ist hier ein Verzeichnis (Directory), das User, Group und Other lesen, verändern und betreten dürfen.
Die zweite Datei ist kein Verzeichnis, nur der User darf lesen und schreiben, die Gruppe darf nur lesen, und die anderen dürfen überhaupt nichts.
\begin{frame}{Mit Linux herumspielen und den Pooltest absolvieren}
\begin{itemize}
\item Ermöglicht euch, gefahrlos mit einem Linux-Terminal herumzuspielen und Befehle zu üben.
\item Es gibt einige Übungsaufgaben im Stile der Aufgaben, die im Pooltest abgefragt werden.
\item Weil die Linux-Umgebung lediglich im Browser simuliert wird, sind nicht alle üblichen Programme verfügbar. Besonders relevant: es gibt \textbf{kein}\texttt{nano}, \texttt{vim} oder \texttt{emacs}.
\begin{itemize}
\item Falls ein Texteditor nötig ist, kann man \texttt{vi} verwenden. Hier gelten die gleichen Tastenkürzel wie bei \texttt{vim}, also insbesondere die komplizierte Methodik zum Schließen des Editors: \keys{ESC} + \texttt{:wq} zum Speichern und \keys{ESC} + \texttt{:q!} zum Verwerfen der Änderungen.
\item Zum Füllen einer Textdatei braucht es nicht immer einen Editor.