LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-22-2012, 08:06 AM   #1
Ajit Gunge
Member
 
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, 08:21 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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.
  


Reply


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 09:00 AM
How to change default shell for All new user on solaris LinuxLover Solaris / OpenSolaris 1 02-11-2010 10:22 AM
How to change the default shell in Linux apdas Linux - Newbie 2 11-11-2009 12:11 PM
How to change the default shell to bash? shadkong Slackware 12 04-23-2005 04:49 PM
How to change default root shell fessin Linux - General 2 02-14-2003 12:25 AM


All times are GMT -5. The time now is 04:45 AM.

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