diff options
| author | Jan Altenberg <jan@jan-laptop.(none)> | 2010-04-30 14:59:16 +0200 |
|---|---|---|
| committer | Jan Altenberg <jan@jan-laptop.(none)> | 2010-04-30 14:59:16 +0200 |
| commit | 6ffd7accf10205f308d6e5c6d070eda0b20b04b8 (patch) | |
| tree | 3ed59e7b28f739611c7e4dc44ba1d82b756938a9 | |
| parent | 4d0408c9ab9d4ac824cae18581c546de247e9acb (diff) | |
Minimalistic presentation for important tools
| -rw-r--r-- | linux-basics/important-tools/Makefile | 9 | ||||
| -rw-r--r-- | linux-basics/important-tools/handout_important_tools_de.tex (renamed from linux-basics/important-tools/handout_important-tools_de.tex) | 0 | ||||
| -rw-r--r-- | linux-basics/important-tools/hints_important_tools_de.tex (renamed from linux-basics/important-tools/hints_important-tools_de.tex) | 0 | ||||
| -rw-r--r-- | linux-basics/important-tools/pres_important_tools_de.tex | 216 |
4 files changed, 224 insertions, 1 deletions
diff --git a/linux-basics/important-tools/Makefile b/linux-basics/important-tools/Makefile new file mode 100644 index 0000000..d949d00 --- /dev/null +++ b/linux-basics/important-tools/Makefile @@ -0,0 +1,9 @@ +all: + pdflatex pres_important_tools_de.tex + pdflatex hints_important_tools_de.tex + pdflatex handout_important_tools_de.tex + pdflatex handout_important_tools_de.tex + +clean: + rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out + diff --git a/linux-basics/important-tools/handout_important-tools_de.tex b/linux-basics/important-tools/handout_important_tools_de.tex index b6e7158..b6e7158 100644 --- a/linux-basics/important-tools/handout_important-tools_de.tex +++ b/linux-basics/important-tools/handout_important_tools_de.tex diff --git a/linux-basics/important-tools/hints_important-tools_de.tex b/linux-basics/important-tools/hints_important_tools_de.tex index 11c5c34..11c5c34 100644 --- a/linux-basics/important-tools/hints_important-tools_de.tex +++ b/linux-basics/important-tools/hints_important_tools_de.tex diff --git a/linux-basics/important-tools/pres_important_tools_de.tex b/linux-basics/important-tools/pres_important_tools_de.tex index 58c6586..ec0b979 100644 --- a/linux-basics/important-tools/pres_important_tools_de.tex +++ b/linux-basics/important-tools/pres_important_tools_de.tex @@ -20,8 +20,222 @@ \tableofcontents \end{frame} +\section{Basiskommandos} +\begin{frame} +\frametitle{Grundlegende Kommandos} +\begin{center} +\begin{tabular}{|l|p{8cm}|} +\hline +\textbf{Kommando} & \textbf{Beschreibung} \\ +\hline +cd DIR & In das Verzeichnis DIR wechseln \\ +\hline +ls DIR & Inhalt von Verzeichnis DIR Anzeigen \\ +\hline +pwd & Aktuelles Verzeichnis ausgeben \\ +\hline +cat FILE & Datei ausgeben \\ +\hline +tac & Datei rückwärts ausgeben ;-) \\ +\hline +\end{tabular} +\end{center} +\end{frame} + + +\begin{frame} +\frametitle{Grundlegende Kommandos} +\begin{center} +\begin{tabular}{|l|p{8cm}|} +\hline +\textbf{Kommando} & \textbf{Beschreibung} \\ +\hline +mkdir DIR & Verzeichnis DIR anlegen \\ +\hline +rmdir DIR & Verzeichnis DIR löschen \\ +\hline +rm & Löschen \\ +\hline +touch FILE & Leere Datei mit dem Namen FILE anlegen \\ +\hline +date & Datum ausgeben \\ +\hline +\end{tabular} +\end{center} +\end{frame} + +\begin{frame} +\frametitle{Grundlegende Kommandos} +\begin{center} +\begin{tabular}{|l|p{8cm}|} +\hline +\textbf{Kommando} & \textbf{Beschreibung} \\ +\hline +mount & Filesystem in Verzeichnisbaum einhängen \\ +\hline +umount & Filesystem von Verzeichnisbaum trennen \\ +\hline +cp & Dateien / Verzeichnisse kopieren \\ +\hline +mv & Datei / Verzeichnis verschieben \\ +\hline +ln & Link anlegen \\ +\hline +\end{tabular} +\end{center} +\end{frame} + \section{Prozesse überwachen} + +\begin{frame}[containsverbatim] +\frametitle{Prozessliste anzeigen mit ps} +\begin{lstlisting}[basicstyle=\ttfamily\fontsize{7}{7}\selectfont] +$ ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +root 1 0.0 0.2 3056 1356 ? Ss 09:31 0:01 /sbin/init +root 2 0.0 0.0 0 0 ? S< 09:31 0:00 [kthreadd] +root 3 0.0 0.0 0 0 ? S< 09:31 0:01 [ksoftirqd/0] +root 4 0.0 0.0 0 0 ? S< 09:31 0:00 [watchdog/0] +\end{lstlisting} +\end{frame} + +\begin{frame} +\frametitle{Gängige ps Optionen} +\begin{center} +\begin{tabular}{|l|p{8cm}|} +\hline +\textbf{Option} & \textbf{Bedeutung} \\ +\hline +a & Alle Prozesse (nicht nur die ''eigenen Prozesse'') anzeigen \\ +\hline +u & ''user-oriented'' format \\ +\hline +x & Auch Prozesse ohne TTY anzeigen \\ +\hline +f & ASCII art Prozess Hierarchie \\ +\hline +\end{tabular} +\end{center} +\end{frame} + +\begin{frame}[containsverbatim] +\frametitle{top} +\begin{lstlisting}[basicstyle=\ttfamily\fontsize{7}{7}\selectfont] +$ top +top - 12:35:14 up 3:03, 5 users, load average: 0.25, 0.32, 0.27 +Tasks: 141 total, 3 running, 138 sleeping, 0 stopped, 0 zombie +Cpu(s): 13.0%us, 4.5%sy, 0.6%ni, 71.6%id, 10.1%wa, 0.1%hi, 0.1%si +Mem: 515144k total, 494964k used, 20180k free, 50928k buffers +Swap: 1020088k total, 150524k used, 869564k free, 124764k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 5760 root 20 0 118m 42m 8824 S 15.5 8.4 3:51.74 Xorg + 6560 jan 20 0 2412 1080 792 R 3.9 0.2 0:00.02 top + 7345 jan 20 0 15112 1620 1396 S 1.9 0.3 0:49.15 esd +[...] +\end{lstlisting} +\end{frame} + +\section{Arbeiten mit Text} + +\begin{frame}[containsverbatim] +\frametitle{Suche nach Text} +\begin{lstlisting}[language=bash] +# In der Datei /etc/hosts nach dem +# Wort localhost suchen +grep localhost /etc/hosts + +# Nach localhost am Zeilenanfang suchen +grep '^localhost' /etc/hosts + +# Nach localhost am Zeilenende suchen +grep 'localhost$' /etc/hosts +\end{lstlisting} +\end{frame} + +\begin{frame}[containsverbatim] +\frametitle{Ausgaben umleiten} +\begin{lstlisting}[language=bash] +# Pipes +ps aux | grep Xorg + +# stderr in ein file umleiten +./myprog 2> error.log + +# stderr nach stdout umleiten +./myprog 2>&1 + +# Alle Ausgaben verwerfen +./mygrog > /dev/null 2>&1 +\end{lstlisting} +\end{frame} + +\begin{frame}[containsverbatim] +\frametitle{Die Pager: more und less} +\begin{lstlisting}[language=bash] +# Display output per page +ps aux | less +# be careful: more is less effective ;-) +ps aux | more +\end{lstlisting} +\end{frame} + +\begin{frame}[containsverbatim] +\frametitle{Text bearbeiten mit sed} +\begin{lstlisting}[language=bash] +# Mehrfache Leerzeichen durch eines ersetzen +cat file.txt | sed 's/ */ /g' + +# Zeilen loeschen, die mit X enden +ps aux | sed '/X$/d' + +# Direkt auf Datei arbeiten +sed --in-place 's/ */ /g' file.txt +\end{lstlisting} +\end{frame} + \section{Mit Archiven arbeiten} -\section{Mit Textdateien / Sourcefiles arbeiten} +\begin{frame}[containsverbatim] +\frametitle{Archive} +\begin{lstlisting}[language=bash] +# Extract a bz2 compressed archive +tar xjvf linux-2.6.32.tar.bz2 + +# Extract a gzip compressed archive +tar xzvf linux-2.6.32.tar.gz + +# Create a bz2 compressed archive +tar cjf linux-2.6.32.tar.bz2 linux-2.6.32/ + +# Display the contents of a gzip archive +zcat linux-2.6.32.tar.gz | tar -t +# or +tar -tzf linux-2.6.32.tar.gz +\end{lstlisting} +\end{frame} + +\section{diff und patch} +\begin{frame}[containsverbatim] +\frametitle{diff} +\begin{lstlisting}[language=bash] +# Unified diff zwischen datei alt.txt und neu.txt +diff -u alt.txt neu.txt + +# Rekursive diffs erzeugen +diff -uprN directory_old directory_new +\end{lstlisting} +\end{frame} + +\begin{frame}[containsverbatim] +\frametitle{Diffs / Patche anwenden} +\begin{lstlisting}[language=bash] +# mydiff.diff anwenden +# + 1. Directory Level ignorieren +patch -p1 < mydiff.diff + +# bz2 gepackten diff anwenden +bzcat patch-2.6.31.13.bz2 | patch -p1 +\end{lstlisting} +\end{frame} \end{document} |
