snippets:shell
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| snippets:shell [2025-11-12 01:28] – Snippet „Einrückung ab der zweiten Zeile“ im neuen Abschnitt „Textverarbeitung“ hinzugefügt. malte70 | snippets:shell [2026-01-21 12:58] (current) – „fortune & cowsay“ um einen Screenshot erweitert malte70 | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ^ Betriebssystem ^ Shell ^ | ^ Betriebssystem ^ Shell ^ | ||
| | macOS & GNU/Linux | '' | | macOS & GNU/Linux | '' | ||
| + | |||
| + | ===== tmux: Shell-Sitzungen im Hintergrund ===== | ||
| + | |||
| + | Um eine Shell-Sitzung zu trennen und im Hintergrund weiter laufen zu lassen kann der Terminal-Multiplexer [[https:// | ||
| + | |||
| + | Im Gegensatz zu '' | ||
| + | |||
| + | ==== Sitzung starten ==== | ||
| + | |||
| + | <code bash> | ||
| + | # Eine neue tmux-Session starten | ||
| + | tmux | ||
| + | |||
| + | # Eine neue Sitzung mit vorgegebenem Namen starten | ||
| + | tmux new -s my_session | ||
| + | </ | ||
| + | |||
| + | ==== Sitzung trennen/ | ||
| + | |||
| + | <code bash> | ||
| + | # Von der aktuellen Sitzung trennen | ||
| + | tmux detach | ||
| + | </ | ||
| + | |||
| + | Tastenkombinationen für //tmux// sind zweiteilig; nach dem drücken von ''< | ||
| + | |||
| + | < | ||
| + | # Von der aktuellen Sitzung trennen | ||
| + | < | ||
| + | |||
| + | # Alle Tastenkombinationen anzeigen | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | ==== Laufende Sitzungen anzeigen ==== | ||
| + | |||
| + | <code bash> | ||
| + | tmux list-session | ||
| + | tmux ls | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | 0: 1 windows (created Mon Jan 19 18:57:53 2026) | ||
| + | yt-dlp: 1 windows (created Mon Jan 19 18:24:51 2026) | ||
| + | </ | ||
| + | |||
| + | ==== Mit Sitzung verbinden ==== | ||
| + | |||
| + | Mit zuletzt aktiver Sitzung verbinden: | ||
| + | |||
| + | <code bash> | ||
| + | tmux attach | ||
| + | </ | ||
| + | |||
| + | Mit einer bestimmten Sitzung verbinden: | ||
| + | |||
| + | <code bash> | ||
| + | tmux attach -t yt-dlp | ||
| + | </ | ||
| ===== OpenSSH ===== | ===== OpenSSH ===== | ||
| Line 134: | Line 193: | ||
| echo " | echo " | ||
| </ | </ | ||
| + | |||
| + | ===== Just for fun: Ein cowsay-Dalek für fortune-Cookies ===== | ||
| + | |||
| + | > Hier sollte irgendwann eine kurze Einführung stehen … | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Installation unter macOS: | ||
| + | |||
| + | <code bash> | ||
| + | # macOS/ | ||
| + | brew install fortune cowsay cowsay-org/ | ||
| + | |||
| + | # Suchpfad für cowsay-Kühe | ||
| + | export COWPATH="/ | ||
| + | </ | ||
| + | |||
| + | Installation unter Fedora (cowsay-files muss hier von Hand installiert werden): | ||
| + | |||
| + | <code bash> | ||
| + | # Fedora: fortune und cowsay via Paketverwaltung installieren | ||
| + | sudo dnf install fortune-mod cowsay | ||
| + | |||
| + | # cowsay-files aus dem Git-Repository von Hand in | ||
| + | # ~/.local installieren | ||
| + | git clone https:// | ||
| + | cd cowsay-files | ||
| + | make prefix=$HOME/ | ||
| + | </ | ||
| + | |||
| + | Natürlich sollte '' | ||
| + | |||
| + | <code bash> | ||
| + | # $COWPATH in .zshenv | ||
| + | echo -e "\n\n# \$COWPATH - Search path for cowsay(1)\nexport COWPATH=\" | ||
| + | |||
| + | # $COWPATH in .bashrc speichern | ||
| + | echo -e "\n\n# \$COWPATH - Search path for cowsay(1)\nexport COWPATH=\" | ||
| + | </ | ||
| + | |||
| + | Nachdem alles eingerichtet ist kann es losgehen. | ||
| + | |||
| + | Im folgenden Beispiel wird ein kurzer ('' | ||
| + | |||
| + | <code bash> | ||
| + | fortune -s literature \ | ||
| + | | cowsay -f dalek -W 42 | ||
| + | </ | ||
| + | |||
| + | ==== bash: Zitat von einem QOTD-Server ==== | ||
| + | |||
| + | Statt eines '' | ||
| + | |||
| + | Oder du führst das [[https:// | ||
| + | |||
| + | **Kleine Warnung**: Das ist mein erstes selbst gebautes Image überhaupt; es erlaubt bisher kaum Anpassungen wie sonst üblich über Umgebungsvariablen. | ||
| + | |||
| + | <code bash> | ||
| + | cowsay -f dalek -W 42 </ | ||
| + | </ | ||
| + | |||
| + | > // | ||
| + | > | ||
| + | > Die Bash erlaubt eine Eingabe-/ | ||
| + | |||
snippets/shell.1762910886.txt.gz · Last modified: by malte70
