{"id":16507,"date":"2024-09-26T21:16:31","date_gmt":"2024-09-26T19:16:31","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=16507"},"modified":"2024-09-26T21:16:33","modified_gmt":"2024-09-26T19:16:33","slug":"history-der-verlauf-im-terminal","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2024\/09\/26\/history-der-verlauf-im-terminal\/","title":{"rendered":"History &#8211; Der Verlauf im Terminal"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Dieser Artikel richtet sich vor allem an Linux-Einsteiger, die erste Ausfl\u00fcge in die Befehlszeile bereits unternommen haben. Also nicht unbedingt Neues f\u00fcr Fortgeschrittene, sondern ein kleiner Beitrag, um das Terminal etwas n\u00e4her zu bringen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0.jpg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"950\" height=\"592\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0.jpg\" alt=\"\" class=\"wp-image-16510\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0.jpg 950w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0-150x93.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0-300x187.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_0-768x479.jpg 768w\" sizes=\"auto, (max-width: 950px) 100vw, 950px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Alle Einstellungen, die \u00fcber die grafische Benutzeroberfl\u00e4che vorgenommen werden, lassen sich in Form von Kommandozeilenbefehlen auch \u00fcber die sogenannte Shell vornehmen. Bei der Shell handelt es sich um ein Programm, das als Schnittstelle zwischen System und Benutzer fungiert. Es umfasst einen Kommandozeileninterpreter, der Benutzereingaben \u00fcber die Tastatur entgegen nimmt, diese auswertet, gegebenenfalls Programme startet und den Output in Form einer Textausgabe an den Benutzer zur\u00fcckgibt. Jede Shell l\u00e4uft in einem Terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Soweit zur Theorie \u2013 Relevant ist es, wie man ein Terminal startet \u2013 z. B. mit der Tastenkombination [Strg+Alt+T] \u2013 und was man darin macht.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verwendet man das Terminal (Kommandozeile\/Befehlszeile\/Linux-Konsole usw.), sammeln sich im Laufe der Zeit viele Befehle an \u2013 im folgenden Beispiel die Systemaktualisierung in Debian mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code><strong>sudo apt update<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Nach Eingabe des Passwortes erh\u00e4lt man vom System eine Ausgabe, ob Aktualisierungen zur Installation vorliegen&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1.jpg\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"597\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1.jpg\" alt=\"\" class=\"wp-image-16513\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1.jpg 945w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1-150x95.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1-300x190.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_1-1-768x485.jpg 768w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Meist sind es einfache, wiederkehrende Befehle, aber auch lange Befehlsketten oder seltene Kommandos. Besonders f\u00fcr Anf\u00e4nger lassen sich diese kaum jederzeit aus dem Ged\u00e4chtnis abrufen. Um den Anwender zu entlasten, bieten die Terminal-Shells eine Unterst\u00fctzung an.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Alle im Terminal ausgef\u00fchrten Befehle werden in einen Speicher geschrieben \u2013 der History \u2013 die auch nach einem Neustart des Computers erhalten bleiben. Dieser Speicher ist nicht fl\u00fcchtig, sondern wird in einer versteckten Datei unter \/home\/user\/.bash_history bzw. \/home\/user\/.zhistory oder \u00e4hnlich gespeichert \u2013 je nachdem welche Shell die jeweilige Distribution verwendet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Versteckte Dateien lassen sich im Dateimanager mit der Tastenkombination [Strg+H] aus- und einblenden.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1.jpg\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"653\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1-1024x653.jpg\" alt=\"\" class=\"wp-image-16515\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1-1024x653.jpg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1-150x96.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1-300x191.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1-768x490.jpg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_2-1.jpg 1349w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Nun lassen wir uns die History unserer Befehle ansehen. Dazu \u00f6ffnen wir das Terminal und f\u00fcgen folgenden Befehl ein:<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code><strong>history<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Die Ausgabe sieht im Beispiel so aus:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3.jpg\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"591\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3.jpg\" alt=\"\" class=\"wp-image-16516\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3.jpg 944w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3-150x94.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3-300x188.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_3-768x481.jpg 768w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit dem Mausrad oder den Cursor-Tasten kann man durch die lange Liste scrollen. Um einen bestimmten Befehl aus der Liste erneut auszuf\u00fchren, gibt man den Befehl <strong><em>!Nummer<\/em><\/strong> ein, wobei die Nummer aus der Liste entnommen wird.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So f\u00fchrt z.B. das Kommando:<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>!236<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">den Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code><strong>sudo apt -t bookworm-backports upgrade<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">erneut aus.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wir befinden uns noch in der History im Terminal.<br>Wei\u00df man in etwa, welchen Text ein Kommando enth\u00e4lt, kann auch die Suchfunktion f\u00fcr die History verwendet werden. Daf\u00fcr gibt es die Tastenkombination [Strg + R].<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4.jpg\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" width=\"946\" height=\"591\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4.jpg\" alt=\"\" class=\"wp-image-16517\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4.jpg 946w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4-150x94.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4-300x187.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_4-768x480.jpg 768w\" sizes=\"auto, (max-width: 946px) 100vw, 946px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Tippen Sie einen beliebigen Text in die sich \u00f6ffnende Suchleiste ein.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bereits w\u00e4hrend der Eingabe werden Suchergebnisse eingeblendet. Passt der Befehl, klicken Sie einfach auf [Enter]. Das Kommando wird sofort ausgef\u00fchrt&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5.jpg\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" width=\"945\" height=\"593\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5.jpg\" alt=\"\" class=\"wp-image-16518\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5.jpg 945w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5-150x94.jpg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5-300x188.jpg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/09\/history_5-768x482.jpg 768w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"16507\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">10    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"16507\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Dieser Artikel richtet sich vor allem an Linux-Einsteiger, die erste Ausfl\u00fcge in die Befehlszeile bereits unternommen haben. Also nicht unbedingt Neues f\u00fcr Fortgeschrittene, sondern ein kleiner Beitrag, um das Terminal etwas n\u00e4her zu bringen. Alle Einstellungen, die \u00fcber die grafische Benutzeroberfl\u00e4che vorgenommen werden, lassen sich in Form von Kommandozeilenbefehlen auch \u00fcber die sogenannte Shell vornehmen. [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":16509,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,101],"tags":[277],"class_list":["post-16507","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-terminal","category-tipps","tag-history"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=16507"}],"version-history":[{"count":5,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16507\/revisions"}],"predecessor-version":[{"id":16520,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/16507\/revisions\/16520"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/16509"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=16507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=16507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=16507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}