{"id":2208,"date":"2015-10-28T21:42:28","date_gmt":"2015-10-28T21:42:28","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=2208"},"modified":"2023-01-28T11:08:54","modified_gmt":"2023-01-28T11:08:54","slug":"how-to-fix-corrupted-bash-bash-profile-on-linux","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/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>&nbsp;<\/p>\n<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>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><\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Be very sure to create the above missing files and enter the code 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>&nbsp;<\/p>\n<p>1. &nbsp;Command &#8211;<\/p>\n<p># <em><strong>vi \/root\/.bash_profile<\/strong><\/em><\/p>\n<p>CODE:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<strong># .bash_profile<\/strong><\/p>\n<p><strong># Get the aliases and functions<\/strong><br \/>\n<strong>if [ -f ~\/.bashrc ]; then<\/strong><br \/>\n<strong>. ~\/.bashrc<\/strong><br \/>\n<strong>fi<\/strong><\/p>\n<p><strong># User specific environment and startup programs<\/strong><\/p>\n<p><strong>PATH=$PATH:$HOME\/bin<\/strong><\/p>\n<p><strong>export PATH<\/strong><br \/>\n<strong>unset USERNAME<\/strong><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;<\/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<strong># .bashrc<\/strong><\/p>\n<p><strong># User specific aliases and functions<\/strong><\/p>\n<p><strong># Source global definitions<\/strong><br \/>\n<strong>if [ -f \/etc\/bashrc ]; then<\/strong><br \/>\n<strong>. \/etc\/bashrc<\/strong><br \/>\n<strong>fi<\/strong><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>&nbsp;<\/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;<\/p>\n<p><strong># ~\/.bash_logout<\/strong><\/p>\n<p><strong>clear<\/strong><\/p>\n<p>&#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>***<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; 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 [&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 v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb<\/title>\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.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"&nbsp; 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 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/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-28T11:08:54+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=\"Estimated 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\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\",\"name\":\"How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2015-10-28T21:42:28+00:00\",\"dateModified\":\"2023-01-28T11:08:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Fix Corrupted Bash (.bash_profile) on Linux.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3\",\"name\":\"Amol Naik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g\",\"caption\":\"Amol Naik\"},\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/amol\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb","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.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","og_locale":"en_GB","og_type":"article","og_title":"How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb","og_description":"&nbsp; 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 [&hellip;]","og_url":"https:\/\/www.milesweb.co.uk\/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-28T11:08:54+00:00","author":"Amol Naik","twitter_misc":{"Written by":"Amol Naik","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/","name":"How To Fix Corrupted Bash (.bash_profile) on Linux. - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2015-10-28T21:42:28+00:00","dateModified":"2023-01-28T11:08:54+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3"},"breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-fix-corrupted-bash-bash-profile-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How To Fix Corrupted Bash (.bash_profile) on Linux."}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd98f9201bc93e38b74b2ba2ac49bd3","name":"Amol Naik","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/13a3e28954a5682af8b75e7135575b72?s=96&d=blank&r=g","caption":"Amol Naik"},"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/amol\/"}]}},"views":3653,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=2208"}],"version-history":[{"count":10,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208\/revisions"}],"predecessor-version":[{"id":14650,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/2208\/revisions\/14650"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=2208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=2208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=2208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}