Latest LQ Deal: Linux Power User Bundle
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-03-2008, 06:49 PM   #1
Registered: Sep 2004
Distribution: RH5.2, RH6.2, RH8.0, RH 9.0, RHEL 3.0,MDK 10.1, KNOPPIX3.6, Solaris 8, Solaris 9, CentOS 3x-4x-5x, U
Posts: 66

Rep: Reputation: 15
automatic change default working directory after graphical login

short description of the problem:
I would like to automagically change the working directory from $HOME to, for example, /proj/$USER after the $USER logs into the machine via the graphical (GUI) login (aka gdm). So, when the $USER opens new terminal, he/she should be in /proj/$USER and __not__ in $HOME
[side note: I am using tsch as my $SHELL]

oo: no, putting 'cd /proj/$USER' into .cshrc is _not_ the solution

oo: yes, putting 'cd /proj/$USER' into .login works if the user logs into the machine using CLI login and then starts the desktop with 'startx' OR if he/she logs to the machine via ssh|telnet. It does not work for gdm (aka graphical login)

oo: no, adding 'cd /proj/$USER' to the file Default or Xsession does __not__ work.


oo: yes, I did read all relevant posts in 'Click Here to Find Similar Threads'.

oo: no, I do not want to change variable $HOME to point to /proj/$USER

oo: no, I do not want to modify /etc/passwd file

Simply put, I am out of ideas. Any hint, RTFM pointer or solution is appreciated.


Last edited by primorec; 05-03-2008 at 06:58 PM. Reason: additional clarification of the open issue
Old 05-05-2008, 04:01 AM   #2
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 54
put it in ~/.tcshrc???
Old 05-05-2008, 05:13 PM   #3
Registered: Sep 2004
Distribution: RH5.2, RH6.2, RH8.0, RH 9.0, RHEL 3.0,MDK 10.1, KNOPPIX3.6, Solaris 8, Solaris 9, CentOS 3x-4x-5x, U
Posts: 66

Original Poster
Rep: Reputation: 15
Originally Posted by yowi View Post
put it in ~/.tcshrc???
Nope, it will not work. '.cshrc' or '.tcshrc' make NO difference.

For example, let suppose, the user will launch the following scrip from /aaa/bbb/cccc. The sript will NOT create the test_file in the current working directory. The file will be created in /proj/$USER, which does not make sense... it is not intuitive.


echo "Hello World" > test_file


Yes, I know, #!/bin/tcsh -f can solve the problem. My users wrote a lot of scripts already without a switch -f so, most of them will not work correctly anymore


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
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 07:33 PM
Automatic Graphical Login for Slackware. duffmckagan Slackware 20 06-08-2005 08:33 AM
Change Graphical to Text Login bigrig2004 Linux - Hardware 2 12-22-2004 05:44 PM
Replacing default graphical login screen with downloaded one coolamit78 Linux - Software 2 10-16-2003 01:39 PM
change graphical login in Gnome nhasbek Linux - Newbie 1 12-12-2002 07:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:56 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