{"id":2208,"date":"2015-10-28T21:42:28","date_gmt":"2015-10-28T21:42:28","guid":{"rendered":"https:\/\/www.milesweb.com\/hosting-faqs\/?p=2208"},"modified":"2023-01-27T19:21:58","modified_gmt":"2023-01-27T13:51:58","slug":"how-to-fix-corrupted-bash-bash-profile-on-linux","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","title":{"rendered":"How To Fix Corrupted Bash (.bash_profile) on Linux"},"content":{"rendered":"<p>Today we will see the process of reinstating a corrupted bash (.bash_profile)&nbsp;in a quick&nbsp;and an&nbsp;easy way. Simply follow the steps given below and recover your corrupted bash profile.<\/p>\n<p>Log into your server via SSH and check for the below mentioned files, because if they aren&#8217;t present then you need to create them on the server one-by-one.<\/p>\n<p><strong>Related:&nbsp;<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-connect-your-server-by-ssh\/\">How To Login to Your Server By SSH?<\/a><\/strong><\/p>\n<p>File 1. &nbsp;# <em><strong>cat \/root\/.bash_profile<\/strong><\/em><\/p>\n<p>File &nbsp;2.&nbsp;# <em><strong>cat \/root\/.bashrc<\/strong><\/em><\/p>\n<p>File &nbsp;3.&nbsp;# <em><strong>cat \/root\/.bash_logout<\/strong><\/em><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Be very sure to create the above missing files and run the following command in each as given below.<\/p>\n<p>Now edit the file with your favorite editor. I&#8217;ll be using vi editor here.<\/p>\n<p>1. &nbsp;Command &#8211;<\/p>\n<p># <em><strong>vi \/root\/.bash_profile<\/strong><\/em><\/p>\n<p>CODE:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n# .bash_profile<\/p>\n<p># Get the aliases and functions<br \/>\nif [ -f ~\/.bashrc ]; then<br \/>\n. ~\/.bashrc<br \/>\nfi<\/p>\n<p># User specific environment and startup programs<\/p>\n<p>PATH=$PATH:$HOME\/bin<\/p>\n<p>export PATH<br \/>\nunset USERNAME<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>2.&nbsp;&nbsp;&nbsp;Command &#8211;<\/p>\n<p># <em><strong>vi \/root\/.bashrc<\/strong><\/em><\/p>\n<p>CODE:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n# .bashrc<\/p>\n<p># User specific aliases and functions<\/p>\n<p># Source global definitions<br \/>\nif [ -f \/etc\/bashrc ]; then<br \/>\n. \/etc\/bashrc<br \/>\nfi<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>3.&nbsp;&nbsp;Command &#8211;<\/p>\n<p># <strong><em>vi \/root\/.bash_logout<\/em><\/strong><\/p>\n<p>CODE:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n# ~\/.bash_logout<\/p>\n<p>clear<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Now&nbsp;logout and log-in again to confirm the changes.<\/p>\n<p><strong>Related:<\/strong>&nbsp;<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/bash-make-command-not-found\/\"><strong>-bash: make: command not found<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we will see the process of reinstating a corrupted bash (.bash_profile)&nbsp;in a quick&nbsp;and an&nbsp;easy way. Simply follow the steps given below and recover your corrupted bash profile. Log into your server via SSH and check for the below mentioned files, because if they aren&#8217;t present then you need to create them on the server [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2208","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-dedicated-server-faq"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Fix Corrupted Bash (.bash_profile) on Linux.<\/title>\n<meta name=\"description\" content=\"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Fix Corrupted Bash (.bash_profile) on Linux.\" \/>\n<meta property=\"og:description\" content=\"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-28T21:42:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-27T13:51:58+00:00\" \/>\n<meta name=\"author\" content=\"Amol Naik\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amol Naik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\"},\"author\":{\"name\":\"Amol Naik\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"headline\":\"How To Fix Corrupted Bash (.bash_profile) on Linux\",\"datePublished\":\"2015-10-28T21:42:28+00:00\",\"dateModified\":\"2023-01-27T13:51:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\"},\"wordCount\":233,\"commentCount\":0,\"articleSection\":[\"Dedicated Server FAQ\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\",\"name\":\"How To Fix Corrupted Bash (.bash_profile) on Linux.\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2015-10-28T21:42:28+00:00\",\"dateModified\":\"2023-01-27T13:51:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"description\":\"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Fix Corrupted Bash (.bash_profile) on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\",\"name\":\"Amol Naik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g\",\"caption\":\"Amol Naik\"},\"sameAs\":[\"https:\/\/www.milesweb.com\/\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/amol\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Fix Corrupted Bash (.bash_profile) on Linux.","description":"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"How To Fix Corrupted Bash (.bash_profile) on Linux.","og_description":"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2015-10-28T21:42:28+00:00","article_modified_time":"2023-01-27T13:51:58+00:00","author":"Amol Naik","twitter_misc":{"Written by":"Amol Naik","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/"},"author":{"name":"Amol Naik","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"headline":"How To Fix Corrupted Bash (.bash_profile) on Linux","datePublished":"2015-10-28T21:42:28+00:00","dateModified":"2023-01-27T13:51:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/"},"wordCount":233,"commentCount":0,"articleSection":["Dedicated Server FAQ"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","name":"How To Fix Corrupted Bash (.bash_profile) on Linux.","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2015-10-28T21:42:28+00:00","dateModified":"2023-01-27T13:51:58+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"description":"Today we will see the process of reinstating a corrupted bash (.bash_profile) in a quick and an easy way.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How To Fix Corrupted Bash (.bash_profile) on Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3","name":"Amol Naik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/051d93e0548382a233b8a429b0813076888d5f179b4297089ac7ca9ed9c75bfb?s=96&d=blank&r=g","caption":"Amol Naik"},"sameAs":["https:\/\/www.milesweb.com\/"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/amol\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=2208"}],"version-history":[{"count":14,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208\/revisions"}],"predecessor-version":[{"id":17416,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208\/revisions\/17416"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=2208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=2208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=2208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}