

{"id":208,"date":"2022-10-04T13:31:43","date_gmt":"2022-10-04T20:31:43","guid":{"rendered":"https:\/\/peden.ece.uw.edu\/computing\/?page_id=208"},"modified":"2025-10-07T14:14:01","modified_gmt":"2025-10-07T21:14:01","slug":"changing-your-login-shell","status":"publish","type":"page","link":"https:\/\/peden.ece.uw.edu\/computing\/linux-lab\/changing-your-login-shell\/","title":{"rendered":"Changing Your Login Shell"},"content":{"rendered":"<p><strong>The default shell environment in our Linux Lab uses bash. However some software used by our students may require a different shell, such as tcsh.<\/strong><\/p>\n<h3><!--more-->Please Read This First<\/h3>\n<p>ECE Computing does not actually recommend you switch your shell, since it can (and frequently does) completely break an inexperienced user&#8217;s login to a Linux computer. Instead, we recommend leaving your login shell alone and just switching to another shell as needed, using one of the following commands (replace &#8220;tcsh&#8221; with whichever shell you wish to run; e.g. csh, zsh). Option 2 is preferred, but either will work:<\/p>\n<pre>(Option 1) \/bin\/tcsh\r\n(Option 2) exec \/bin\/tcsh -l   # that's a lowercase \"L\", not a \"one\"<\/pre>\n<p>However, we realize some people prefer to work in a shell other than bash by default.<\/p>\n<h3>How to Switch Your Shell<\/h3>\n<p>At present, it&#8217;s technically not possible to change your default shell away from bash on ECE systems. Practically speaking, however, you can accomplish the same thing by adding the following lines at the <strong>very top<\/strong> of the file .bash_profile that&#8217;s in your home directory (you&#8217;ll need to create the file if it doesn\u2019t already exist):<\/p>\n<pre>PREFERRED_SHELL=\"tcsh\"\r\nPREFERRED_SHELL_LOCATION=$(which $PREFERRED_SHELL)\r\nif [[ $PREFERRED_SHELL_LOCATION != \"\" ]] ; then\r\n   echo \"$PREFERRED_SHELL found - switching...\"\r\n   exec $PREFERRED_SHELL_LOCATION -l\r\nelse\r\n   echo \"Did not find $PREFERRED_SHELL - falling back to bash...\"\r\nfi\r\n<\/pre>\n<p>Copy everything *exactly* as shown above (even the spacing) into your .bash_profile file.<\/p>\n<p>In the first line you can change \u201ctcsh\u201d to any valid shell, such as \u201czsh\u201d &#8211; but be careful not to add any spaces around the equals sign if you do that.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default shell environment in our Linux Lab uses bash. However some software used by our students may require a different shell, such as tcsh.<\/p>\n<div><a class=\"more\" href=\"https:\/\/peden.ece.uw.edu\/computing\/linux-lab\/changing-your-login-shell\/\">Read more<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"parent":111,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"tags":[16],"class_list":["post-208","page","type-page","status-publish","hentry","tag-linux"],"_links":{"self":[{"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/pages\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/comments?post=208"}],"version-history":[{"count":9,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/pages\/208\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/pages\/208\/revisions\/764"}],"up":[{"embeddable":true,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/pages\/111"}],"wp:attachment":[{"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peden.ece.uw.edu\/computing\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}