mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-27 20:21:56 +01:00
300 lines
6.9 KiB
TeX
300 lines
6.9 KiB
TeX
|
\documentclass[a4paper,11pt]{report}
|
||
|
%\usepackage{isolatin1}
|
||
|
%\usepackage{german}
|
||
|
\usepackage{float}
|
||
|
\usepackage{listings}
|
||
|
\usepackage{graphicx}
|
||
|
\usepackage{lastpage}
|
||
|
\usepackage{fancyhdr}
|
||
|
\usepackage{soul}
|
||
|
|
||
|
\usepackage{lmodern} % Latin Modern
|
||
|
|
||
|
\usepackage[ngerman]{babel, translator}
|
||
|
\usepackage[utf8]{inputenc}
|
||
|
|
||
|
|
||
|
%\usepackage[ngerman]{babel, translator}
|
||
|
|
||
|
|
||
|
%\usepackage[utf8x]{inputenc}
|
||
|
\usepackage[left=2.5cm,top=2cm,right=2cm,bottom=4cm]{geometry}
|
||
|
|
||
|
%Code listings
|
||
|
\usepackage{listings}
|
||
|
\usepackage{etoolbox}
|
||
|
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
|
||
|
|
||
|
|
||
|
\usepackage[]{hyperref}
|
||
|
\hypersetup{
|
||
|
linkcolor=blue,
|
||
|
pagecolor= blue,
|
||
|
urlcolor= blue,
|
||
|
colorlinks=true,
|
||
|
pdfborder=0 0 0
|
||
|
}
|
||
|
\usepackage[
|
||
|
nonumberlist, %keine Seitenzahlen anzeigen
|
||
|
acronym, %ein Abk�rzungsverzeichnis erstellen
|
||
|
toc, %Eintr�ge im Inhaltsverzeichnis
|
||
|
section] %im Inhaltsverzeichnis auf section-Ebene erscheinen
|
||
|
{glossaries}
|
||
|
|
||
|
|
||
|
\usepackage{hyperref}
|
||
|
|
||
|
%Ein eigenes Symbolverzeichnis erstellen
|
||
|
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
|
||
|
|
||
|
%Den Punkt am Ende jeder Beschreibung deaktivieren
|
||
|
\renewcommand*{\glspostdescription}{}
|
||
|
|
||
|
|
||
|
|
||
|
%Glossar-Befehle anschalten
|
||
|
\makeglossaries
|
||
|
|
||
|
%Diese Befehle sortieren die Eintr�ge in den
|
||
|
%einzelnen Listen:
|
||
|
%makeindex -s datei.ist -t datei.alg -o datei.acr datei.acn
|
||
|
%makeindex -s datei.ist -t datei.glg -o datei.gls datei.glo
|
||
|
%makeindex -s datei.ist -t datei.slg -o datei.syi datei.syg
|
||
|
|
||
|
|
||
|
|
||
|
% define acronyms here
|
||
|
\newacronym{PDF}{PDF}{Portable Document Format}
|
||
|
\newacronym{APDU}{APDU}{Application Protocol Data Unit}
|
||
|
\newacronym{AGPL}{AGPL}{Affero General Public License}
|
||
|
\newacronym{GPL}{GPL}{General Public License}
|
||
|
\newacronym{LGPL}{LGPL}{Lesser General Public License}
|
||
|
|
||
|
|
||
|
\newacronym{DCT}{DCT}{Discrete Cosine Transform}
|
||
|
\newacronym{TTA}{TTA}{Trusted Timestamp Authority}
|
||
|
\newacronym{OCSP}{OCSP}{Online Certificate Status Protocol}
|
||
|
\newacronym{PKI}{PKI}{Public Key Infrastructure}
|
||
|
|
||
|
|
||
|
|
||
|
%\newacronym{BDD}{BDD}{Behaviour Driven Development\protect\glsadd{glos:BDD}}
|
||
|
|
||
|
\newglossaryentry{Application Protocol Data Unit}
|
||
|
{
|
||
|
name={Application Protocol Data Unit},
|
||
|
description={blablabla}
|
||
|
}
|
||
|
|
||
|
\newglossaryentry{Copyleft}
|
||
|
{
|
||
|
name={Copyleft},
|
||
|
description={The copyleft ist the obligation required by the GLP (or AGPL) license to offer the source code of a work (and every derivative of it) to the public (open source). Copy{\bf{left}} can also be considered as the opposite of copy{\bf{right}}. }
|
||
|
}
|
||
|
|
||
|
|
||
|
%Befehle f�r Glossar
|
||
|
|
||
|
\usepackage{helvet}
|
||
|
\renewcommand{\familydefault}{\sfdefault}
|
||
|
|
||
|
\renewcommand\contentsname{Inhaltsverzeichnis}
|
||
|
|
||
|
|
||
|
%Einstellungen f??r code listings
|
||
|
\lstset{inputencoding=utf8, language=Java,tabsize=2, basicstyle=\small,breaklines=true,showstringspaces=false}
|
||
|
\pagestyle{fancy}
|
||
|
\setlength{\headheight}{38pt}
|
||
|
\setlength{\headwidth}{470pt}
|
||
|
\renewcommand{\headrule}{\hskip -\leftskip{\bf \quad \quad}\vbox to 5pt{\hbox to 455pt{\hrulefill}}}
|
||
|
\renewcommand{\footrule}{\hskip-\leftskip{\bf \quad \quad}{\hbox to 450 pt{\hrulefill}\newline}}
|
||
|
\fancyhf{}
|
||
|
\fancyheadoffset[L]{1cm}
|
||
|
\fancyfootoffset[L]{1cm}
|
||
|
%Kopfzeile links bzw. innen
|
||
|
\fancyhead[L]{\includegraphics[height=0.6in]{img/bfsulogo.jpg}}
|
||
|
%Kopfzeile mittig
|
||
|
\fancyhead[C]{}
|
||
|
%Kopfzeile rechts bzw. au??????????�?en
|
||
|
\fancyhead[R]{\hspace{10pt} Modul 122\\Abläufe mit Skripts/Makros automatisieren\\ \rightmark }
|
||
|
\fancyheadoffset[L]{1cm}
|
||
|
\fancyfootoffset[L]{1cm}
|
||
|
%Linie oben
|
||
|
\renewcommand{\headrulewidth}{0.7pt}
|
||
|
%Fu??????????�?zeile mittig
|
||
|
\cfoot{\vspace*{6mm}page:\ \thepage\ of \pageref{LastPage}}
|
||
|
\fancyfoot[R]{}
|
||
|
% footnote in footer
|
||
|
\newcommand{\fancyfootnotetext}[2]{%
|
||
|
\fancypagestyle{dingens}{%
|
||
|
\fancyfoot[LO,RE]{\parbox{12cm}{\footnotemark[#1]\footnotesize #2}}%
|
||
|
}%
|
||
|
\thispagestyle{dingens}%
|
||
|
}
|
||
|
%Linie unten
|
||
|
\renewcommand{\footrulewidth}{0.5pt}
|
||
|
|
||
|
\vspace*{15mm}
|
||
|
\textwidth 450pt
|
||
|
|
||
|
|
||
|
|
||
|
\begin{document}
|
||
|
|
||
|
\setcounter{tocdepth}{5}
|
||
|
|
||
|
|
||
|
|
||
|
%\thispagestyle{empty}
|
||
|
|
||
|
\begin{center}
|
||
|
|
||
|
\vspace{48pt}
|
||
|
|
||
|
|
||
|
\vspace{15pt}
|
||
|
\begin{huge}
|
||
|
\end{huge}
|
||
|
\vspace{10pt}
|
||
|
\begin{center}
|
||
|
\begin{Large}
|
||
|
Bash\\ \vspace{20pt}
|
||
|
Übung 1 - Beispiellösungen
|
||
|
\end{Large}
|
||
|
\end{center}
|
||
|
|
||
|
\vspace{10pt}
|
||
|
|
||
|
\end{center}
|
||
|
|
||
|
\begin{scriptsize}
|
||
|
\begin{center}
|
||
|
\noindent Mario Bischof
|
||
|
\end{center}
|
||
|
\end{scriptsize}
|
||
|
\newpage
|
||
|
\noindent{\bf{Aufgabe 1 - Repetition: Navigieren in Verzeichnissen}}
|
||
|
\begin{quote}
|
||
|
\begin{enumerate}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: ] cd ~
|
||
|
\end{verbatim}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: ~ ] cd /var/log
|
||
|
\end{verbatim}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: log ] cd /etc/udev
|
||
|
\end{verbatim}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: udev ] cd ..
|
||
|
\end{verbatim}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: udev ] cd network
|
||
|
\end{verbatim}
|
||
|
\item \begin{verbatim}
|
||
|
[root@localhost: network ] cd ../../dev
|
||
|
\end{verbatim}
|
||
|
\end{enumerate}\vspace{10pt}
|
||
|
\end{quote}
|
||
|
\noindent {\bf{Aufgabe 2 - stdout, stdin, stderr:}}
|
||
|
\begin{quote}
|
||
|
{\bf{a)}} \begin{verbatim}
|
||
|
ls -z 2> /root/errorsLs.log
|
||
|
\end{verbatim}
|
||
|
{\bf{b)}} \begin{verbatim}
|
||
|
echo "sdfonsdodsf" > datei.txt
|
||
|
cat datei.txt > datei2.txt
|
||
|
cat datei.txt > datei2.txt
|
||
|
cat datei2.txt
|
||
|
cat datei.txt >> datei2.txt
|
||
|
cat datei.txt >> datei2.txt
|
||
|
cat datei2.txt
|
||
|
# Unterschied, >> hängt Inhalt an, > überschreibt Inhalt
|
||
|
cat datei.txt >> datei.txt
|
||
|
# Erzeugt Fehler, Quell- ist Zieldatei
|
||
|
\end{verbatim}
|
||
|
{\bf{c)}}
|
||
|
\begin{verbatim}
|
||
|
whoami > info.txt
|
||
|
\end{verbatim}
|
||
|
{\bf{d)}}
|
||
|
\begin{verbatim}
|
||
|
id >> info.txt
|
||
|
\end{verbatim}
|
||
|
{\bf{e)}}
|
||
|
\begin{verbatim}
|
||
|
cat info-txt | wc -w
|
||
|
\end{verbatim}
|
||
|
\end{quote}
|
||
|
\noindent {\bf{Aufgabe 3 - grep, cut:}}
|
||
|
\begin{quote}
|
||
|
{\bf{a)}}
|
||
|
\begin{verbatim}
|
||
|
cat file.txt | grep obelix
|
||
|
cat file.txt | grep 2
|
||
|
cat file.txt | grep e
|
||
|
cat file.txt | grep -v gamma
|
||
|
cat file.txt | grep -E "1|2|3"
|
||
|
\end{verbatim}
|
||
|
|
||
|
{\bf{b)}}
|
||
|
\begin{verbatim}
|
||
|
cat file.txt | cut -d ':' -f 1
|
||
|
cat file.txt | cut -d ':' -f 2
|
||
|
cat file.txt | cut -d ':' -f 3
|
||
|
\end{verbatim}
|
||
|
\vspace{10pt}
|
||
|
\end{quote}
|
||
|
|
||
|
{\bf{Aufgabe 4 - Wildcards:}}
|
||
|
\begin{quote}
|
||
|
\begin{enumerate}
|
||
|
\item \verb|mkdir ~/Docs|
|
||
|
\item \verb|touch ~/Docs/file{1..10}|
|
||
|
\item \verb|rm -f ~/Docs/file1*|
|
||
|
\item \verb|rm -f ~/Docs/file[247]|
|
||
|
\item \verb|rm -f ~/Docs/* oder rm -f ~/Docs/file*|
|
||
|
\end{enumerate}
|
||
|
|
||
|
\begin{enumerate}
|
||
|
\item \verb|mkdir Files|, \verb|cd Files|
|
||
|
\item \verb|touch file{1..10}| (Erzeugt fileX von 1 bis 10)
|
||
|
\item \verb|cd ..| , \verb|cp -R Files Files2|
|
||
|
\item \verb|cp -R Files Files2/Files3|
|
||
|
\item \verb|mv Files Files1|
|
||
|
\item \verb|rm -f *|
|
||
|
\end{enumerate}
|
||
|
\end{quote}
|
||
|
\vspace{10pt}
|
||
|
{\bf{Aufgabe 5 - Tilde expansions:}}
|
||
|
\begin{quote}
|
||
|
\begin{itemize}
|
||
|
\item Siehe Präsentationsfolien
|
||
|
\end{itemize}
|
||
|
\end{quote}
|
||
|
|
||
|
\vspace{10pt}
|
||
|
{\bf{Aufgabe 6 - Für Fortgeschrittene:}}
|
||
|
\begin{quote}
|
||
|
\begin{itemize}
|
||
|
\item
|
||
|
\begin{verbatim}
|
||
|
Findet alle Zeilen, welche eine PCI-Adresse beinhalten
|
||
|
\end{verbatim}
|
||
|
\item
|
||
|
\begin{verbatim}
|
||
|
Findet IP-Adressen
|
||
|
\end{verbatim}
|
||
|
\item
|
||
|
\begin{verbatim}
|
||
|
Findet alle Dateien, welche dem Benutzer root gehören ( -user root ),
|
||
|
im Dateinamen das Wort bash vorkommt ( -iname "*bash*", Gross- und
|
||
|
Kleinschreibung wird ignoriert) und kopiert diese nach
|
||
|
/root ( -exec cp {} /root/ ).
|
||
|
\end{verbatim}
|
||
|
\end{itemize}
|
||
|
\end{quote}
|
||
|
\end{document}
|
||
|
|
||
|
|