LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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-30-2013, 12:26 AM   #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, 07:12 PM   #2
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 312

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, 07:21 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 01: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, 10:17 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
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, 10: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, 11:01 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
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 11:02 AM.
 
  


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


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