{"id":10095,"date":"2016-02-15T15:29:28","date_gmt":"2016-02-15T17:29:28","guid":{"rendered":"https:\/\/cleuber.com.br\/?p=10095"},"modified":"2016-02-15T15:29:28","modified_gmt":"2016-02-15T17:29:28","slug":"como-mudar-o-shell-que-estou-usando","status":"publish","type":"post","link":"https:\/\/cleuber.com.br\/index.php\/2016\/02\/15\/como-mudar-o-shell-que-estou-usando","title":{"rendered":"Como Mudar o Shell Que Estou Usando?"},"content":{"rendered":"<p>No Linux temos diversas distribui\u00e7\u00f5es e\u00a0os usu\u00e1rios mais avan\u00e7ados usam muito o terminal para facilitar a execu\u00e7\u00e3o de v\u00e1rios tipos de tarefas. O terminal funciona como um emulador do seu ambiente shell de seu Linux e te d\u00e1 uma\u00a0ambiente para voc\u00ea rodar os programas e comandos por meio da digita\u00e7\u00e3o de texto.<\/p>\n<p>Mas os sistemas operacionais Gnu\/Linux, possuem mais de um ambiente shell em que voc\u00ea pode se logar\/usar, sendo os mais comumente usados o bash e o sh, e voc\u00ea pode instalar mais de um ou troc\u00e1-los quando estiver em seu terminal.<\/p>\n<h3>1 &#8211; Como eu Vejo Quais Shells eu Tenho Dispon\u00edvel em meu Sistema?<\/h3>\n<p>D\u00ea uma olhada no arquivo \/etc\/shells<\/p>\n<pre>$ cat \/etc\/shells\r\n# \/etc\/shells: valid login shells\r\n\/bin\/csh\r\n\/bin\/sh\r\n\/usr\/bin\/es\r\n\/usr\/bin\/ksh\r\n\/bin\/ksh\r\n\/usr\/bin\/rc\r\n\/usr\/bin\/tcsh\r\n\/bin\/tcsh\r\n\/usr\/bin\/esh\r\n\/bin\/dash\r\n\/bin\/bash\r\n\/bin\/rbash\r\n\/usr\/bin\/screen\r\n\/bin\/ksh93<\/pre>\n<p>Ou pode usar o comando &#8220;chsh -l&#8221; para listar<\/p>\n<pre>$ chsh -l\r\n\/bin\/csh\r\n\/bin\/sh\r\n\/usr\/bin\/es\r\n\/usr\/bin\/ksh\r\n(...)<\/pre>\n<h3>2 &#8211; Como eu vejo Qual Shell eu estou Usando Agora?<\/h3>\n<p>Use o comando echo $0 para verificar isso.<\/p>\n<pre>$ echo $0\r\n\/bin\/bash<\/pre>\n<p>Obs. Este acima mostrar\u00e1 qual o Shell que est\u00e1 usando no momento (pode ter sido mudado temporariamente).<br \/>\nPara ver qual o Shell permanente do login use o comando:<\/p>\n<pre>echo $SHELL\r\n\/bin\/bash<\/pre>\n<h3>3 &#8211; Como Eu Mudo Meu Shell Atual Para Outro Temporariamente?<\/h3>\n<pre>$ echo $0\r\n\/bin\/bash\r\n\r\n$ <span style=\"background-color: #ffff00;\">exec \/bin\/sh<\/span>\r\n\r\n$ echo $0\r\n\/bin\/sh<\/pre>\n<p>Obs. Quando voc\u00ea fizer login novamente, voltar\u00e1 ao seu Shell padr\u00e3o<\/p>\n<p>Ou voc\u00ea pode apenas abrir um novo shell com o comando \/bin\/nome-do-shell, por exemplo:<\/p>\n<pre>\/bin\/sh<\/pre>\n<p>ou<\/p>\n<pre>\/bin\/tcsh<\/pre>\n<p>Ou outro. Tecle Ctrl+D para fechar o novo shell aberto e voltar a usar o que est\u00e1 como padr\u00e3o.<\/p>\n<h3>4 &#8211; Como Eu Mudo Meu Shell Para Outro Permanentemente?<\/h3>\n<p>Use o comando chsh para realizar a troca. No exemplo abaixo trocarei para o zsh.<\/p>\n<pre>$ chsh -s \/bin\/zsh\r\nPassword:<\/pre>\n<p>Obs. Desta forma, mesmo ap\u00f3s o login, o shell escolhido ficar\u00e1.<\/p>\n<h3>5 &#8211; Instalando um Novo Shell<\/h3>\n<p>Voc\u00ea pode instalar um novo se desejar, como por exemplo o ksh, que mostrarei abaixo. Depois de instalado, voc\u00ea poder\u00e1 us\u00e1-lo de forma tempor\u00e1ria ou permanente como expliquei. Use seu instalador de pacotes, ou Gerenciador de Pacotes, ou Central de Programas para instalar o shell desejado.<\/p>\n<p>No exemplo abaixo usarei o apt-get do Debian\/Ubuntu e derivados no terminal, para instalar um novo shell.<\/p>\n<pre>$ sudo apt-get install ksh<\/pre>\n<p>\u00c9 isso a\u00ed pessoal,<\/p>\n<p>Abra\u00e7os,<\/p>\n<p>Cleuber<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No Linux temos diversas distribui\u00e7\u00f5es e\u00a0os usu\u00e1rios mais avan\u00e7ados usam muito o terminal para facilitar a execu\u00e7\u00e3o de v\u00e1rios tipos de tarefas. O terminal funciona como um emulador do seu ambiente shell de seu Linux e te d\u00e1 uma\u00a0ambiente para voc\u00ea rodar os programas e comandos por meio da digita\u00e7\u00e3o de texto. Mas os sistemas &hellip;<\/p>\n","protected":false},"author":1,"featured_media":10098,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[51,4],"tags":[548,547],"class_list":["post-10095","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dicas-e-tutoriais","category-tutoriais-linux","tag-bash","tag-shell"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/posts\/10095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=10095"}],"version-history":[{"count":0,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/posts\/10095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/media\/10098"}],"wp:attachment":[{"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=10095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=10095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cleuber.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=10095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}