{"id":20116,"date":"2025-09-09T09:52:18","date_gmt":"2025-09-09T07:52:18","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=20116"},"modified":"2025-09-09T10:30:50","modified_gmt":"2025-09-09T08:30:50","slug":"bashrc-kurz-erklaert","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2025\/09\/09\/bashrc-kurz-erklaert\/","title":{"rendered":"bashrc &#8211; Kurz erkl\u00e4rt"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Die Datei bashrc unter Linux regelt die individuelle Konfiguration der Bash-Shell, indem sie bei jedem \u00d6ffnen eines interaktiven Terminals automatisch geladen wird. Sie enth\u00e4lt pers\u00f6nliche Einstellungen wie Aliase, Funktionen, Umgebungsvariablen und das Aussehen des Prompts \u2013 und erlaubt es, Skripte oder zus\u00e4tzliche Befehle beim Start der Shell auszuf\u00fchren.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Was passiert in der bashrc?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die bashrc liegt im Home-Verzeichnis eines jeden Nutzers und wird immer dann ausgef\u00fchrt, wenn ein Terminal im interaktiven Modus gestartet wird.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"658\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01-1024x658.png\" alt=\"\" class=\"wp-image-20119\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01-1024x658.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01-150x96.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01-300x193.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01-768x494.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_01.png 1112w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"has-text-align-center has-small-font-size wp-block-paragraph\">.bashrc &#8211; Versteckte Datei im home-Ordner<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Folgende Dinge werden hier typischerweise geregelt:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Aliase:<\/strong><br>Kurzbefehle f\u00fcr oft benutzte Kommandos, etwa alias ll=&#8217;ls -la&#8216;<br><strong>Funktionen:<\/strong><br>Komplexere, eigene Shell-Befehle, die Aufgaben automatisieren<br><strong>Umgebungsvariablen:<\/strong><br>Zum Beispiel export PATH=$PATH:\/home\/user\/bin<br><strong>Prompt-Design:<\/strong><br>Einstellung des Aussehens der Kommandozeile (PS1) f\u00fcr bessere \u00dcbersicht<br><strong>Automatisches Ausf\u00fchren von Programmen oder Skripten:<\/strong><br>Etwa das Anzeigen von Systeminfos beim Start<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Beispiele f\u00fcr die Anwendung in der bahsrc<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03-1024x627.png\" alt=\"\" class=\"wp-image-20122\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03-1024x627.png 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03-150x92.png 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03-300x184.png 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03-768x470.png 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/09\/bashrc_03.png 1417w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"has-text-align-center has-small-font-size wp-block-paragraph\">bashrc &#8211; Anwendungsbeispiele<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Unterschied zu anderen Konfigurationsdateien<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Neben der bashrc gibt es die bash_profile sowie die globale \/etc\/bash.bashrc:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-table is-style-stripes has-small-font-size\"><table><tbody><tr><td><strong>Datei<\/strong><\/td><td><strong>Wirkung<\/strong><\/td><td><strong>Wann ausgef\u00fchrt<\/strong><\/td><td><strong>Typische Nutzung<\/strong><\/td><\/tr><tr><td>\/etc\/bash.bashr<\/td><td>Alle Nutzer<\/td><td>bei interaktiven Shells<\/td><td>Standard-Einstellungen f\u00fcr alle User<\/td><\/tr><tr><td>~\/.bashr<\/td><td>Nutzer-spezifisch<\/td><td>bei neuem Terminal<br>(Shell)<\/td><td>pers\u00f6nliche Anpassungen, Aliase,<br>Funktionen<\/td><\/tr><tr><td>~\/.bash_profile<\/td><td>Nutzer-spezifisch<\/td><td>beim Login<\/td><td>Einmalige Einstellungen pro Session, z.B. SSH<\/td><\/tr><tr><td>~\/.profile<\/td><td>Nutzer-spezifisch<\/td><td>Als Fallback (Login)<\/td><td>generische Einstellungen f\u00fcr verschiedene Shells<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Sicherheitshinweis<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Da die bashrc vom Benutzer ver\u00e4ndert werden kann, besteht auch ein gewisses Sicherheitsrisiko.<br>Sch\u00e4dliche Befehle oder manipulierte Aliase k\u00f6nnten in die Datei geschrieben werden. <br><br>Daher empfiehlt sich ein vorsichtiger Umgang:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Nur vertrauensw\u00fcrdige Inhalte einf\u00fcgen<br>&#8211; Vor \u00c4nderungen ein Backup erstellen<br>&#8211; Bei sicherheitsrelevanten Systemen die Datei ggf. vor \u00c4nderungen sch\u00fctzen<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Fazit<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die bashrc ist das Herzst\u00fcck der pers\u00f6nlichen Shell-Konfiguration unter Linux. Sie verbessert den Workflow durch Automatisierungen, individuell angepasste Befehle und ein flexibles Terminal-Design. Wer produktiver oder komfortabler am Linux-Terminal arbeiten will, sollte sich die M\u00f6glichkeiten dieser Datei genauer anschauen \u2013 aber immer mit Bedacht und Sicherheitsbewusstsein.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Titelbild: <a href=\"http:\/\/www.freepik.com\">Designed by Freepik<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Datei bashrc unter Linux regelt die individuelle Konfiguration der Bash-Shell, indem sie bei jedem \u00d6ffnen eines interaktiven Terminals automatisch geladen wird. Sie enth\u00e4lt pers\u00f6nliche Einstellungen wie Aliase, Funktionen, Umgebungsvariablen und das Aussehen des Prompts \u2013 und erlaubt es, Skripte oder zus\u00e4tzliche Befehle beim Start der Shell auszuf\u00fchren. Was passiert in der bashrc? Die bashrc [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":20125,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[539,17],"tags":[1380,1381],"class_list":["post-20116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dienstprogramme","category-system","tag-bashrc","tag-automatisieren"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/20116","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=20116"}],"version-history":[{"count":10,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/20116\/revisions"}],"predecessor-version":[{"id":20257,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/20116\/revisions\/20257"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/20125"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=20116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=20116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=20116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}