Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-22-2012, 07:06 AM   #1
Ajit Gunge
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
Question How to change the default shell?

How can I change my default shell to csh.currently the shell is ksh and I want to change it to csh.If I dont have root credentials is there a way I can do this?
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-22-2012, 07:21 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,943
Blog Entries: 14

Rep: Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160
The shell is specified by the entry in /etc/passwd for the user and modifying default shell there requires root access.

However what you can do is REPLACE you shell with the exec commnand:

exec csh

That will replace your running shell process with csh.

That is as compared to doing just "csh" which forks out a subshell so that both bash and csh are running. When you exit a exec'ed process you exit the system. When you exit a forked process you go back to the previous shell.

To make the exec happen automatically on each login you could modify your $HOME/.bashrc or $HOME/.bash_profile to do the "exec csh".

Note that the files invoked for csh are not the same as those for bash so you might have to create your own. The global one (which you likely can't edit) is /etc/csh.cshrc and the local ones in your home are .tcshrc or .cshrc. You can override global variable settings from csh.cshrc in the .tcsrc or .cshrc as the latter get invoked after the former.
2 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'd like to change the default shell prompt. lynnevan Linux - General 9 09-08-2011 08:00 AM
How to change default shell for All new user on solaris LinuxLover Solaris / OpenSolaris 1 02-11-2010 09:22 AM
How to change the default shell in Linux apdas Linux - Newbie 2 11-11-2009 11:11 AM
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 03:49 PM
How to change default root shell fessin Linux - General 2 02-13-2003 11:25 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration