LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-29-2013, 11:26 PM   #1
xmldba
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
Terminal logging


In order to make the .bash_probfile read on login, is it better to longin to xterminal with -login option? I am using gnome desktop.
 
Old 05-30-2013, 06:12 PM   #2
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 322

Rep: Reputation: 59
Welcome to LQ
Quote:
Originally Posted by xmldba View Post
In order to make the .bash_probfile read on login, is it better to longin to xterminal with -login option? I am using gnome desktop.
I don't think it matters
 
Old 05-30-2013, 06:21 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you've got bash set as your login shell in /etc/passwd, it'll read it automatically (& .bashrc if its there)
 
Old 05-31-2013, 12:22 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by xmldba View Post
In order to make the .bash_probfile read on login, is it better to longin to xterminal with -login option? I am using gnome desktop.
As Chris said, simply change your login shell in /etc/passwd file, then logout and login again so the shell will automatically read your ~/.bashrc or ~/.profile file.

However, explain the issue little more for specific answers.
 
Old 05-31-2013, 09:17 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by shivaa View Post
As Chris said, simply change your login shell in /etc/passwd file, then logout and login again so the shell will automatically read your ~/.bashrc or ~/.profile file.
If you want to have an existing shell session reflect any changes you've made in your shell config file(s), you can always simply source the config file(s), as they are simply shell scripts:
Code:
. ~/.bashrc
This removes the need to log out & log in. You would need to do this for each currently open shell session.

--- rod.
 
Old 05-31-2013, 09:22 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by theNbomr View Post
This removes the need to log out & log in. You would need to do this for each currently open shell session.
Little correction. In order to avoid sourcing the ~/.bashrc everytime you login, better change your login shell in /etc/passwd, so you won't need to source the file.

Edit the /etc/passwd file, and make change like this:
Code:
username:x:1234:1234::/home/username:/bin/bash
 
Old 05-31-2013, 10:01 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by shivaa View Post
Little correction. In order to avoid sourcing the ~/.bashrc everytime you login, better change your login shell in /etc/passwd, so you won't need to source the file.
You completely missed my point. For existing shell sessions, you don't need to log out and then login again; simply source the startup script to pull in the changes. I've even seen people recommend to reboot the host in order for their changes to take effect. This is completely un-necessary.
--- rod.

Last edited by theNbomr; 05-31-2013 at 10:02 AM.
 
  


Reply



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
Terminal 0.2.6 output logging clonas Linux From Scratch 2 08-29-2008 03:19 AM
logging into the root in terminal MrSako Linux - Newbie 3 06-22-2006 03:14 AM
Logging into another terminal gianh Linux - Newbie 4 04-22-2006 03:39 PM
X Terminal Session Logging phiw1123 Linux - Software 1 04-26-2005 03:15 PM
Logging into Mandrake 9.2 from terminal fleeced Linux - Newbie 1 08-15-2004 01:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 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
Open Source Consulting | Domain Registration