{"id":2035,"date":"2020-02-06T18:14:28","date_gmt":"2020-02-06T18:14:28","guid":{"rendered":"https:\/\/profi-tutorials.de\/linux\/?p=2035"},"modified":"2020-03-13T11:29:33","modified_gmt":"2020-03-13T11:29:33","slug":"eingabe-ausgabe-umleitungen","status":"publish","type":"post","link":"https:\/\/profi-tutorials.de\/linux\/grundlagen\/eingabe-ausgabe-umleitungen\/","title":{"rendered":"Eingabe- \/ Ausgabe-Umleitungen (I\/O-Redirections)"},"content":{"rendered":"<p>Sogenannte I\/O-Redirections (Eingabe- \/ Ausgabe-Umleitungen) sind ein sehr m&auml;chtiges Werkzeug f&uuml;r Linux- und UNIX-Betriebssysteme. Die Ausgaben von Befehlen wie <strong>ls<\/strong> oder <strong>cat<\/strong> werden normalerweise direkt im <a class=\"glossaryLink cmtt_Informatik\" aria-describedby=\"tt\" data-cmtooltip=\"&lt;div class=glossaryItemTitle&gt;TTY [Teletype]&lt;\/div&gt;&lt;div class=glossaryItemBody&gt;TTY steht f&uuml;r Teletype, welches das englische Wort f&uuml;r Fernschreiber ist, und steht in einem UNIX-System f&uuml;r ein Terminal.&lt;\/div&gt;&lt;div class=cmtt_synonyms_wrapper&gt;&lt;div class=cmtt_synonyms_title&gt;Synonyms: &lt;\/div&gt;&lt;div class=cmtt_synonyms&gt;Terminal&lt;\/div&gt;&lt;\/div&gt;\" href=\"https:\/\/profi-tutorials.de\/linux\/glossar\/tty\/\" target=\"_blank\" data-mobile-support=\"0\" data-gt-translate-attributes='[{\"attribute\":\"data-cmtooltip\", \"format\":\"html\"}]' tabindex=\"0\" role=\"link\">Terminal<\/a> ausgegeben. Die in diesem Beitrag vorgestellten Notationen erm&ouml;glichen eine Umleitung solcher Ausgaben in Dateien oder auch in andere Befehle.<\/p>\n<h2 id=\"tab-con-4\">Standard-Output<\/h2>\n<p>Die Ausgaben eines Befehls werden grunds&auml;tzlich in den sogenannten Standard-Output (stdout) geleitet. Dieser leitet die Ergebnisse dann normalerweise direkt in die Ausgabe des Terminals um.<\/p>\n<h3 id=\"tab-con-2\">Umleitungen mit &gt;<\/h3>\n<p>Mit <strong>&gt;<\/strong> k&ouml;nnen die Ausgaben eines Befehls in Dateien umgeleitet werden. Die Ausgaben &uuml;berschreiben dabei jeglichen Inhalt der angegebenen Datei. Bei mehrfacher Ausf&uuml;hrung bleiben vergangene Ausgaben nicht erhalten.<\/p>\n<p>Falls die angegebene Datei noch nicht existiert, wird sie neu angelegt.<\/p>\n<p>Es folgt ein kurzes Beispiel mit dem Befehl <strong>ls<\/strong>.<\/p>\n<h5>Beispiel: &gt;<\/h5>\n<h6>Eingabe:<\/h6>\n<p>ls \/home\/hellberg\/daten\/ &gt; verzeichnisse.txt<\/p>\n<h6>Ausgabe (cat verzeichnisse.txt):<\/h6>\n<p>edvberatung-hannoverhaus-verwaltung-hannoverit-consulting-hannoveronline-kurseprofi-tutorials<\/p>\n<p>verzeichnisse.txt<\/p>\n<h6>Bemerkung:<\/h6>\n<p>Die neu erstellte Datei &ldquo;verzeichnisse.txt&rdquo; wird ebenfalls in die Ausgabe des <strong>ls<\/strong>-Befehls aufgenommen.<\/p>\n<h3 id=\"tab-con-3\">Umleitungen mit &gt;&gt;<\/h3>\n<p>Soll der Inhalt einer Datei nicht &uuml;berschrieben, sondern stattdessen die neue Ausgabe an das Ende der Datei angeh&auml;ngt werden, so wird <strong>&gt;&gt;<\/strong> verwendet. Es folgt ein kurzes Beispiel.<\/p>\n<h5>Beispiel: &gt;&gt;<\/h5>\n<h6>Eingabe:<\/h6>\n<p>date &gt;&gt; zeit.txt<\/p>\n<h6>Ausgabe (cat zeit.txt):<\/h6>\n<p>Do 6. Feb 12:03:55 CET 2020<\/p>\n<h6>Bemerkung:<\/h6>\n<p>Die von dem Befehl erstellte Datei zeit.txt enth&auml;lt nun die Ausgabe des <strong>date<\/strong> Befehls. Bisher gibt es keine Abweichungen zur Funktionsweise im vorigen Beispiel.<\/p>\n<h6>Wiederholung der Eingabe:<\/h6>\n<p>date &gt;&gt; zeit.txt<\/p>\n<h6>Ausgabe (cat zeit.txt):<\/h6>\n<p>Do 6. Feb 12:03:55 CET 2020Do 6. Feb 12:04:07 CET 2020<\/p>\n<h6>Bemerkung:<\/h6>\n<p>Die Datei &ldquo;zeit.txt&rdquo; wurde nicht &uuml;berschrieben. Stattdessen wurde die Ausgabe der zweiten Ausf&uuml;hrung des <strong>date<\/strong> Befehls an das Ende der Datei &ndash; in eine neue Zeile &ndash; geschrieben.<\/p>\n<h2 id=\"tab-con-8\">Standard-Input<\/h2>\n<p>Viele Befehle nehmen Eingaben aus dem sogenannten Standard-Input (stdin) an. Diese Eingaben werden normalerweise &uuml;ber die Tastatur durchgef&uuml;hrt. Auch hier kann eine Umleitung erfolgen, um beispielsweise den Inhalt einer Datei als Eingabe zu verwenden. Mit dem Operator <strong>&lt;<\/strong> kann eine solche Umleitung erfolgen.<\/p>\n<h5>Beispiel: &lt;<\/h5>\n<p>Ziel dieses Beispiels ist es, eine unsortierte Textdatei mit Benutzernamen in den <strong>sort<\/strong> Befehl zu leiten, um diese zu sortieren.<\/p>\n<h6>Inhalt der Textdatei (cat benutzer.txt):<\/h6>\n<p>hedvadminahellbergbibo<\/p>\n<h6>Eingabe:<\/h6>\n<p>sort &lt; benutzer.txt<\/p>\n<h6>Ausgabe:<\/h6>\n<p>adminabibohedvhellberg<\/p>\n<h6>Bemerkung:<\/h6>\n<p>Der Inhalt der Datei &ldquo;benutzer.txt&rdquo; wurde an den <strong>sort <\/strong>Befehl weitergeleitet. Dieser hat die Eintr&auml;ge dann sortiert und im Terminal ausgegeben.<\/p>\n<h2 id=\"tab-con-5\">Die Kombination von Input und Output<\/h2>\n<p>Auch eine Kombination beider Operatoren ist m&ouml;glich. So k&ouml;nnen zum Beispiel die Inhalte einer Datei in einen Befehl und dessen Ausgabe in eine Datei geleitet werden.<\/p>\n<h5>Beispiel: &lt; in Kombination mit &gt;<\/h5>\n<p>Auch hier wird wieder die unsortierte Liste &ldquo;benutzer.txt&rdquo; an den sort Befehl &uuml;bergeben. Anschlie&szlig;end erfolgt eine Umleitung in die Datei &ldquo;benutzer_sortiert.txt&rdquo;<\/p>\n<h6>Inhalt der Textdatei (cat benutzer.txt):<\/h6>\n<p>hedvadminahellbergbibo<\/p>\n<h6>Eingabe:<\/h6>\n<p>sort &lt; benutzer.txt &gt; benutzer_sortiert.txt<\/p>\n<h6>Ausgabe (cat benutzer_sortiert.txt):<\/h6>\n<p>adminabibohedvhellberg<\/p>\n<h2 id=\"tab-con-1\">Pipelines (&ldquo;Rohrleitungen&rdquo;)<\/h2>\n<p>Mit sogenannten Pipelines bzw. &ldquo;Rohrleitungen&rdquo; ist es m&ouml;glich, mehrere Befehle miteinander zu verbinden. Der Standard-Output (stdout) des einen Befehls wird dabei in den Standard-Input (stdin) eines weiteren Befehls geleitet. Beliebig viele Befehle k&ouml;nnen auf diese Weise miteinander &ldquo;verkettet&rdquo; werden.<\/p>\n<p>Zum Verst&auml;ndnis folgt nun ein kurzes Beispiel mit den beiden Befehlen <strong>sort<\/strong> und <strong>head<\/strong>.<\/p>\n<h5>Beispiel: Pipelines<\/h5>\n<p>Wir wollen wieder die &ldquo;benutzer.txt&rdquo; sortieren, anschlie&szlig;end jedoch nur den ersten Benutzer der sortierten Liste im Terminal ausgeben. Dazu wird die Ausgabe des Befehls <strong>sort <\/strong>mit einer&nbsp;<strong>Pipe<\/strong>&nbsp;in den Input des&nbsp;<strong>head<\/strong> Befehls &uuml;bergeben.<\/p>\n<h6>Inhalt der Textdatei (cat benutzer.txt):<\/h6>\n<p>hedvadminahellbergbibo<\/p>\n<h6>Eingabe:<\/h6>\n<p>sort benutzer.txt | head -n 1<\/p>\n<h6>Ausgabe:<\/h6>\n<p>admina<\/p>\n<h2 id=\"tab-con-6\">Das Video zu diesem Beitrag<\/h2>\n<p style=\"text-align: center;\">Abonniere JETZT unseren Newsletter!<\/p>\n<p style=\"text-align: center;\">Verpasse nie wieder <strong>neue<\/strong> Beitr&auml;ge und <strong>exklusive Insider-Only-Inhalte!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sogenannte I\/O-Redirections (Eingabe- \/ Ausgabe-Umleitungen) sind ein sehr m\u00e4chtiges Werkzeug f\u00fcr Linux- und UNIX-Betriebssysteme. Die Ausgaben von Befehlen wie ls oder cat werden normalerweise direkt im Terminal ausgegeben. Die in diesem Beitrag vorgestellten Notationen erm\u00f6glichen eine Umleitung solcher Ausgaben in Dateien oder auch in andere Befehle. Standard-Output Die Ausgaben eines Befehls werden grunds\u00e4tzlich in den [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1503,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","tve_updated_post":"<div class=\"thrv_wrapper thrv_text_element\"><p>Sogenannte I\/O-Redirections (Eingabe- \/ Ausgabe-Umleitungen) sind ein sehr m\u00e4chtiges Werkzeug f\u00fcr Linux- und UNIX-Betriebssysteme. Die Ausgaben von Befehlen wie <strong>ls<\/strong> oder <strong>cat<\/strong> werden normalerweise direkt im Terminal ausgegeben. Die in diesem Beitrag vorgestellten Notationen erm\u00f6glichen eine Umleitung solcher Ausgaben in Dateien oder auch in andere Befehle.<\/p><\/div><div class=\"thrv_wrapper thrv_contents_table\" data-columns=\"2\" data-headers=\"h1,h2,h3\">\n\t<div class=\"tve_contents_table\">\n\t\t<span class=\"tve_ct_title\" style=\"\" data-css=\"tve-u-1701a08e706\">Inhaltsverzeichnis<\/span>\n\t\t<div class=\"tve_ct_content tve_clearfix\"><div class=\"ct_column sep\" style=\"width: 50%; min-height: 139px;\"><div class=\"tve_ct_level1\"><a href=\"#tab-con-4\" rel=\"nofollow\">Standard-Output<\/a><\/div><div class=\"tve_ct_level2\"><a href=\"#tab-con-2\" rel=\"nofollow\">Umleitungen mit &gt;<\/a><\/div><div class=\"tve_ct_level2\"><a href=\"#tab-con-3\" rel=\"nofollow\">Umleitungen mit &gt;&gt;<\/a><\/div><div class=\"tve_ct_level1\"><a href=\"#tab-con-8\" rel=\"nofollow\">Standard-Input<\/a><\/div><div class=\"tve_ct_level1\"><a href=\"#tab-con-5\" rel=\"nofollow\">Die Kombination von Input und Output<\/a><\/div><\/div><div class=\"ct_column\" style=\"width: 50%; min-height: 139px;\"><div class=\"tve_ct_level1\"><a href=\"#tab-con-1\" rel=\"nofollow\">Pipelines (\"Rohrleitungen\")<\/a><\/div><div class=\"tve_ct_level1\"><a href=\"#tab-con-6\" rel=\"nofollow\">Das Video zu diesem Beitrag<\/a><\/div><\/div><\/div>\n\t<\/div>\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h2 class=\"\" id=\"tab-con-4\">Standard-Output<\/h2><p>Die Ausgaben eines Befehls werden grunds\u00e4tzlich in den sogenannten Standard-Output (stdout) geleitet. Dieser leitet die Ergebnisse dann normalerweise direkt in die Ausgabe des Terminals um.<\/p><h3 class=\"\" id=\"tab-con-2\">Umleitungen mit &gt;<\/h3><p>Mit <strong>&gt;<\/strong> k\u00f6nnen die Ausgaben eines Befehls in Dateien umgeleitet werden. Die Ausgaben \u00fcberschreiben dabei jeglichen Inhalt der angegebenen Datei. Bei mehrfacher Ausf\u00fchrung bleiben vergangene Ausgaben nicht erhalten.<\/p><p>Falls die angegebene Datei noch nicht existiert, wird sie neu angelegt.<\/p><p>Es folgt ein kurzes Beispiel mit dem Befehl <strong>ls<\/strong>.<\/p><\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-1701a1cb28f\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1701a1cb28e\" style=\"\"><h5 class=\"\" data-css=\"tve-u-1701a1cb28d\">Beispiel: &gt;<\/h5><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"2\" data-color-d=\"rgb(66, 66, 66)\" data-css=\"tve-u-1701a1cb290\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a1cb293\"><p data-css=\"tve-u-1701a1cb292\">ls \/home\/hellberg\/daten\/ &gt; verzeichnisse.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe (cat verzeichnisse.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a1cb291\"><p data-css=\"tve-u-1701a1cb295\">edvberatung-hannover<br>haus-verwaltung-hannover<br>it-consulting-hannover<br>online-kurse<br>profi-tutorials<\/p><p data-css=\"tve-u-1701a1cb295\">verzeichnisse.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Bemerkung:<\/h6><p data-css=\"tve-u-1701a285713\">Die neu erstellte Datei \"verzeichnisse.txt\" wird ebenfalls in die Ausgabe des <strong>ls<\/strong>-Befehls aufgenommen.<\/p><\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h3 class=\"\" id=\"tab-con-3\">Umleitungen mit &gt;&gt;<\/h3><p>Soll der Inhalt einer Datei nicht \u00fcberschrieben, sondern stattdessen die neue Ausgabe an das Ende der Datei angeh\u00e4ngt werden, so wird <strong>&gt;&gt;<\/strong> verwendet. Es folgt ein kurzes Beispiel.<\/p><\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-1701a2d27d1\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1701a2d27cf\" style=\"\"><h5 class=\"\" data-css=\"tve-u-1701a2d27ce\">Beispiel: &gt;&gt;<\/h5><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"2\" data-color-d=\"rgb(66, 66, 66)\" data-css=\"tve-u-1701a2d27d2\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d5\"><p data-css=\"tve-u-1701a2d27d4\">date &gt;&gt; zeit.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe (cat zeit.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">Do 6. Feb 12:03:55 CET 2020<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Bemerkung:<\/h6><p data-css=\"tve-u-1701a285713\">Die von dem Befehl erstellte Datei zeit.txt enth\u00e4lt nun die Ausgabe des <strong>date<\/strong> Befehls. Bisher gibt es keine Abweichungen zur Funktionsweise im vorigen Beispiel.<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Wiederholung der Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d5\"><p data-css=\"tve-u-1701a2d27d4\">date &gt;&gt; zeit.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe (cat zeit.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">Do 6. Feb 12:03:55 CET 2020<br>Do 6. Feb 12:04:07 CET 2020<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Bemerkung:<\/h6><p data-css=\"tve-u-1701a285713\">Die Datei \"zeit.txt\" wurde nicht \u00fcberschrieben. Stattdessen wurde die Ausgabe der zweiten Ausf\u00fchrung des <strong>date<\/strong> Befehls an das Ende der Datei - in eine neue Zeile - geschrieben.<\/p><\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h2 class=\"\" id=\"tab-con-8\">Standard-Input<\/h2><p>Viele Befehle nehmen Eingaben aus dem sogenannten Standard-Input (stdin) an. Diese Eingaben werden normalerweise \u00fcber die Tastatur durchgef\u00fchrt. Auch hier kann eine Umleitung erfolgen, um beispielsweise den Inhalt einer Datei als Eingabe zu verwenden. Mit dem Operator <strong>&lt;<\/strong> kann eine solche Umleitung erfolgen.<\/p><\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-1701a2d27d1\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1701a2d27cf\" style=\"\"><h5 class=\"\" data-css=\"tve-u-1701a2d27ce\">Beispiel: &lt;<\/h5><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"2\" data-color-d=\"rgb(66, 66, 66)\" data-css=\"tve-u-1701a2d27d2\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><p data-css=\"tve-u-1701a285713\">Ziel dieses Beispiels ist es, eine unsortierte Textdatei mit Benutzernamen in den <strong>sort<\/strong> Befehl zu leiten, um diese zu sortieren.<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Inhalt der Textdatei (cat benutzer.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d5\"><p data-css=\"tve-u-1701a2d27d4\">hedv<br>admina<br>hellberg<br>bibo<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">sort &lt; benutzer.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">admina<br>bibo<br>hedv<br>hellberg<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Bemerkung:<\/h6><p data-css=\"tve-u-1701a285713\">Der Inhalt der Datei \"benutzer.txt\" wurde an den <strong>sort <\/strong>Befehl weitergeleitet. Dieser hat die Eintr\u00e4ge dann sortiert und im Terminal ausgegeben.<\/p><\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h2 class=\"\" id=\"tab-con-5\">Die Kombination von Input und Output<\/h2><p>Auch eine Kombination beider Operatoren ist m\u00f6glich. So k\u00f6nnen zum Beispiel die Inhalte einer Datei in einen Befehl und dessen Ausgabe in eine Datei geleitet werden.<\/p><\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-1701a2d27d1\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1701a2d27cf\" style=\"\"><h5 class=\"\" data-css=\"tve-u-1701a2d27ce\">Beispiel: &lt; in Kombination mit &gt;<\/h5><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"2\" data-color-d=\"rgb(66, 66, 66)\" data-css=\"tve-u-1701a2d27d2\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><p data-css=\"tve-u-1701a285713\">Auch hier wird wieder die unsortierte Liste \"benutzer.txt\" an den sort Befehl \u00fcbergeben. Anschlie\u00dfend erfolgt eine Umleitung in die Datei \"benutzer_sortiert.txt\"<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Inhalt der Textdatei (cat benutzer.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d5\"><p data-css=\"tve-u-1701a2d27d4\">hedv<br>admina<br>hellberg<br>bibo<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">sort &lt; benutzer.txt &gt; benutzer_sortiert.txt<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe (cat benutzer_sortiert.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">admina<br>bibo<br>hedv<br>hellberg<\/p><\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><h2 class=\"\" id=\"tab-con-1\">Pipelines (\"Rohrleitungen\")<\/h2><p>Mit sogenannten Pipelines bzw. \"Rohrleitungen\" ist es m\u00f6glich, mehrere Befehle miteinander zu verbinden. Der Standard-Output (stdout) des einen Befehls wird dabei in den Standard-Input (stdin) eines weiteren Befehls geleitet. Beliebig viele Befehle k\u00f6nnen auf diese Weise miteinander \"verkettet\" werden.<\/p><p>Zum Verst\u00e4ndnis folgt nun ein kurzes Beispiel mit den beiden Befehlen <strong>sort<\/strong> und <strong>head<\/strong>.<\/p><\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-1701a2d27d1\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1701a2d27cf\" style=\"\"><h5 class=\"\" data-css=\"tve-u-1701a2d27ce\">Beispiel: Pipelines<\/h5><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"2\" data-color-d=\"rgb(66, 66, 66)\" data-css=\"tve-u-1701a2d27d2\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\"><p data-css=\"tve-u-1701a285713\">Wir wollen wieder die \"benutzer.txt\" sortieren, anschlie\u00dfend jedoch nur den ersten Benutzer der sortierten Liste im Terminal ausgeben. Dazu wird die Ausgabe des Befehls <strong>sort <\/strong>mit einer&nbsp;<strong>Pipe<\/strong>&nbsp;in den Input des&nbsp;<strong>head<\/strong> Befehls \u00fcbergeben.<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Inhalt der Textdatei (cat benutzer.txt):<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d5\"><p data-css=\"tve-u-1701a2d27d4\">hedv<br>admina<br>hellberg<br>bibo<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Eingabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">sort benutzer.txt | head -n 1<\/p><\/div><div class=\"thrv_wrapper thrv_text_element\"><h6 class=\"\">Ausgabe:<\/h6><\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-1701a2d27d3\"><p data-css=\"tve-u-1701a2d27d6\">admina<\/p><\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\" style=\"padding-bottom: 0px !important; padding-left: 0px !important;\" data-css=\"tve-u-1709c5d0ee5\">\n\t<div class=\"tve-content-box-background\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\"><h2 class=\"\" id=\"tab-con-6\">Das Video zu diesem Beitrag<\/h2><\/div><div class=\"thrv_wrapper thrv-button tve_ea_thrive_video\" data-css=\"tve-u-1709c5d0ee3\" data-tcb_hover_state_parent=\"\" data-button-style=\"border_1\">\n\t<a href=\"\" class=\"tcb-button-link tve_evt_manager_listen tve_et_click\" data-tcb-events=\"__TCB_EVENT_[{&quot;config&quot;:{&quot;s&quot;:&quot;youtube&quot;,&quot;p&quot;:{&quot;a&quot;:true,&quot;id&quot;:&quot;k7pti_4_o6g&quot;,&quot;url&quot;:&quot;https:\/\/youtu.be\/k7pti_4_o6g&quot;}},&quot;a&quot;:&quot;thrive_video&quot;,&quot;t&quot;:&quot;click&quot;}]_TNEVE_BCT__\" style=\"\">\n\t\t<span class=\"tcb-button-texts\">Starte das Video...<\/span>\n\t<\/a>\n<\/div><\/div>\n<\/div><div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\" style=\"\" data-css=\"tve-u-170d3a8d634\">\n\t<div class=\"tve-content-box-background\" style=\"\" data-css=\"tve-u-170d3a8d637\"><\/div>\n\t<div class=\"tve-cb\"><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-170d3a8d636\"><p data-css=\"tve-u-170d3a8d632\" style=\"text-align: center;\">Abonniere JETZT unseren Newsletter!<\/p><\/div><div class=\"thrv_wrapper thrv-divider\" data-style-d=\"tve_sep-1\" data-thickness-d=\"3\" data-color-d=\"rgb(70, 70, 70)\" data-css=\"tve-u-170d3a8d639\" style=\"\">\n\t<hr class=\"tve_sep tve_sep-1\" style=\"\">\n<\/div><div class=\"thrv_wrapper thrv_text_element\" style=\"\" data-css=\"tve-u-170d3a8d635\"><p data-css=\"tve-u-170d3a8d63a\" style=\"text-align: center;\">Verpasse nie wieder <strong>neue<\/strong> Beitr\u00e4ge und <strong>exklusive Insider-Only-Inhalte!<\/strong><\/p><\/div><div class=\"thrv_wrapper thrv_lead_generation\" data-connection=\"custom-html\" data-css=\"tve-u-170d3a8d63b\" style=\"\"><input type=\"hidden\" class=\"tve-lg-err-msg\" value=\"{&quot;email&quot;:&quot;Email address invalid&quot;,&quot;phone&quot;:&quot;Phone number invalid&quot;,&quot;password&quot;:&quot;Password invalid&quot;,&quot;passwordmismatch&quot;:&quot;Password mismatch error&quot;,&quot;required&quot;:&quot;Required field missing&quot;}\">\n\t<div class=\"thrv_lead_generation_container tve_clearfix\"><form method=\"post\" action=\"#\" id=\"ktv2-form-200765\" novalidate=\"novalidate\"><input type=\"hidden\" class=\"tve-f-a-hidden\" value=\"https:\/\/www.klick-tipp.com\/api\/subscriber\/signin.html\"><input id=\"apikey\" type=\"hidden\" name=\"apikey\" value=\"4nv5z2tonz8za09b\"><div class=\"tve_lead_generated_inputs_container\"><div class=\"tve_lg_input_container tve_lg_input\"><input name=\"fields[fieldFirstName]\" id=\"\" type=\"text\" placeholder=\"Name\" value=\"\" data-css=\"tve-u-1709bd3f99e\" data-placeholder=\"Name\"><\/div><div class=\"tve_lg_input_container tve_lg_input\"><input name=\"email\" id=\"\" type=\"text\" placeholder=\"E-Mail\" value=\"\" data-required=\"1\" data-validation=\"email\" data-css=\"tve-u-1709bd3f99e\" data-placeholder=\"E-Mail\"><\/div><div class=\"tve_lg_input_container tve_submit_container tve_lg_submit\" data-css=\"tve-u-170d3a8d63c\"><button type=\"submit\" class=\"\">KLICKE HIER F\u00dcR ABO!<\/button><\/div><\/div><\/form><\/div>\n<div class=\"thrv_lead_generation_code\" style=\"display: none;\">__CONFIG_lead_generation_code__&lt;div id=\"form-200765-wrapper\"&gt;&lt;form id=\"ktv2-form-200765\" accept-charset=\"UTF-8\" method=\"post\" action=\"https:\/\/www.klick-tipp.com\/api\/subscriber\/signin.html\" &gt;&lt;input type=\"hidden\" name=\"apikey\" value=\"4nv5z2tonz8za09b\" \/&gt;&lt;input type=\"text\" name=\"fields[fieldFirstName]\"\/&gt;&lt;input type=\"text\" name=\"email\"\/&gt;&lt;\/form&gt;&lt;\/div&gt;__CONFIG_lead_generation_code__<\/div><\/div><\/div>\n<\/div>","tve_custom_css":"@import url(\"\/\/fonts.googleapis.com\/css?family=Open+Sans:400,600&subset=latin\");@media (min-width: 300px){[data-css=\"tve-u-1701a08e706\"] { background-color: var(--tcb-color-3); }:not(#tve) [data-css=\"tve-u-1701a1cb28d\"] { padding-top: 0px !important; margin-top: 0px !important; }[data-css=\"tve-u-1701a1cb28e\"] { overflow: hidden; background-color: transparent !important; background-image: none !important; border-radius: 0px !important; }[data-css=\"tve-u-1701a1cb28f\"] { border-radius: 30px; overflow: hidden; background-image: linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; }[data-css=\"tve-u-1701a1cb290\"] .tve_sep { border-width: 2px !important; border-color: rgb(66, 66, 66) !important; }[data-css=\"tve-u-1701a1cb290\"] { padding-top: 0px !important; padding-bottom: 10px !important; }[data-css=\"tve-u-1701a1cb291\"] { background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0.13)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; margin-bottom: 0px !important; padding: 5px 10px !important; }:not(#tve) [data-css=\"tve-u-1701a1cb292\"] { font-family: \"Courier New\", Courier, monospace !important; font-weight: var(--g-regular-weight, normal)  !important; padding-bottom: 0px !important; margin-bottom: 0px !important; }[data-css=\"tve-u-1701a1cb293\"] { background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0.13)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; margin-bottom: 0px !important; padding: 5px 10px !important; }:not(#tve) [data-css=\"tve-u-1701a1cb295\"] { padding-bottom: 0px !important; margin-bottom: 0px !important; font-family: \"Courier New\", Courier, monospace !important; font-weight: var(--g-regular-weight, normal)  !important; }:not(#tve) [data-css=\"tve-u-1701a285713\"] { padding-bottom: 0px !important; margin-bottom: 0px !important; }:not(#tve) [data-css=\"tve-u-1701a2d27ce\"] { padding-top: 0px !important; margin-top: 0px !important; }[data-css=\"tve-u-1701a2d27cf\"] { overflow: hidden; background-color: transparent !important; background-image: none !important; border-radius: 0px !important; }[data-css=\"tve-u-1701a2d27d1\"] { border-radius: 30px; overflow: hidden; background-image: linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; }[data-css=\"tve-u-1701a2d27d2\"] .tve_sep { border-width: 2px !important; border-color: rgb(66, 66, 66) !important; }[data-css=\"tve-u-1701a2d27d2\"] { padding-top: 0px !important; padding-bottom: 10px !important; }[data-css=\"tve-u-1701a2d27d3\"] { background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0.13)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; margin-bottom: 0px !important; padding: 5px 10px !important; }:not(#tve) [data-css=\"tve-u-1701a2d27d4\"] { font-family: \"Courier New\", Courier, monospace !important; font-weight: var(--g-regular-weight, normal)  !important; padding-bottom: 0px !important; margin-bottom: 0px !important; }[data-css=\"tve-u-1701a2d27d5\"] { background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0.13)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; margin-bottom: 0px !important; padding: 5px 10px !important; }:not(#tve) [data-css=\"tve-u-1701a2d27d6\"] { padding-bottom: 0px !important; margin-bottom: 0px !important; font-family: \"Courier New\", Courier, monospace !important; font-weight: var(--g-regular-weight, normal)  !important; }[data-css=\"tve-u-1709c5d0ee3\"] .tcb-button-link { border-bottom: 4px solid rgb(33, 72, 112); border-radius: 4px; border-top-color: rgb(220, 220, 220); border-right-color: rgb(220, 220, 220); border-left-color: rgb(220, 220, 220); background-image: none !important; background-color: rgb(51, 103, 153) !important; }:not(#tve) [data-css=\"tve-u-1709c5d0ee3\"]:hover .tcb-button-link { background-color: rgb(41, 84, 127) !important; }[data-css=\"tve-u-1709c5d0ee5\"] { margin-top: 0px !important; margin-bottom: 0px !important; padding: 0px !important; }:not(#tve) [data-css=\"tve-u-170d3a8d632\"] { font-size: 25px !important; font-weight: var(--g-bold-weight, bold)  !important; padding-bottom: 0px !important; margin-bottom: 0px !important; padding-top: 0px !important; margin-top: 0px !important; color: rgb(70, 70, 70) !important; --tcb-applied-color:var$(--tcb-color-1)  !important; }[data-css=\"tve-u-170d3a8d634\"] { padding: 10px !important; }[data-css=\"tve-u-170d3a8d635\"] { margin-left: 0px !important; margin-right: 0px !important; padding-right: 30px !important; padding-left: 30px !important; }[data-css=\"tve-u-170d3a8d636\"] { margin-right: 0px !important; margin-left: 0px !important; }[data-css=\"tve-u-170d3a8d637\"] { border-radius: 30px; overflow: hidden; background-image: linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; }[data-css=\"tve-u-170d3a8d639\"] .tve_sep { border-width: 3px !important; border-color: rgb(70, 70, 70) !important; }[data-css=\"tve-u-170d3a8d639\"] { padding-top: 0px !important; }:not(#tve) [data-css=\"tve-u-170d3a8d63a\"] { color: rgb(70, 70, 70) !important; --tcb-applied-color:var$(--tcb-color-1)  !important; padding-bottom: 0px !important; margin-bottom: 0px !important; font-size: 18px !important; }[data-css=\"tve-u-170d3a8d63b\"] { float: none; border: none; max-width: 500px !important; margin-left: auto !important; margin-right: auto !important; }:not(#tve) [data-css=\"tve-u-170d3a8d63c\"] button { border-bottom: 4px solid rgb(33, 72, 112); border-radius: 4px; border-top: none; border-right: none; border-left: none; font-weight: var(--tve-font-weight, var(--g-bold-weight, bold)); font-family: var(--tve-font-family, \"Open Sans\"); font-size: var(--tve-font-size, 18px); text-transform: var(--tve-text-transform, uppercase); background-image: none !important; background-color: rgb(51, 103, 153) !important; }:not(#tve) [data-css=\"tve-u-170d3a8d63c\"]:hover button { background-image: none !important; background-color: rgb(41, 84, 127) !important; border-color: rgb(229, 227, 227) rgb(229, 227, 227) rgb(24, 54, 86) !important; }[data-css=\"tve-u-170d3a8d63c\"] { --tve-font-weight:var(--g-bold-weight, bold); --tve-font-family:\"Open Sans\"; --g-regular-weight:400; --g-bold-weight:600; --tve-font-size:18px; --tve-text-transform:uppercase; }}","tve_user_custom_css":"","tve_globals":{"e":"1","font_cls":[]},"tcb2_ready":1,"tcb_editor_enabled":1,"tve_landing_page":"","_tve_header":"0","_tve_footer":"0"},"categories":[7],"tags":[],"class_list":["post-2035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-grundlagen"],"_links":{"self":[{"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/posts\/2035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/comments?post=2035"}],"version-history":[{"count":70,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/posts\/2035\/revisions"}],"predecessor-version":[{"id":3639,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/posts\/2035\/revisions\/3639"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/media\/1503"}],"wp:attachment":[{"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/media?parent=2035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/categories?post=2035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/profi-tutorials.de\/linux\/wp-json\/wp\/v2\/tags?post=2035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}