LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Thread Tools
Old 11-06-2009, 02:13 PM   #1
wisdom
Member
 
Registered: Feb 2004
Distribution: Fedora 9
Posts: 226
Thanked: 2
command line not showing path


[Log in to get rid of this advertisement]
I am using fedora 9 and gnome desktop, my problem is this, i remove all the hidden files from my home directory because i needed to basically so i could get the standard desktop back without my own configuration, however i notice after that when i load up the terminal I get the following
Quote:
-bash-3.2$ su
And I have to sudo in order to see any shell related information to the user who I am login under. as shown below
Quote:
[root@linuxbox username]#
Any idea how i can stop it loading stright to

Quote:
-bash-3.2$ su
and back to the normal way in which I had it setup before showing the username and the machine name?
thanks
windows_xp_2003 wisdom is offline     Reply With Quote
Old 11-06-2009, 02:37 PM   #2
bertl
LQ Newbie
 
Registered: May 2004
Location: Amsterdam, Holland
Distribution: Ubuntu, Redhat (others in the past)
Posts: 28
Thanked: 10
You will have probably had a .profile or .bash_profile file in there that a snippet like this in there (this is taken from Ubuntu, not identical but a good base):

Code:
if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
	. /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi
Hope that helps - Bert
linuxubuntu bertl is offline     Reply With Quote
Old 11-06-2009, 02:44 PM   #3
wisdom
Member
 
Registered: Feb 2004
Distribution: Fedora 9
Posts: 226
Thanked: 2

Original Poster
Never mind I have solved the issue all I had to do is copy the following files to my own home directory from another account.

Quote:
.bash_history .bash_logout .bash_profile .bashrc

Last edited by wisdom; 11-06-2009 at 02:46 PM..
windows_xp_2003 wisdom is offline     Reply With Quote
Old 11-06-2009, 02:56 PM   #4
colucix
Guru
 
Registered: Sep 2003
Location: Bologna, Italia
Distribution: OpenSUSE 11.1 CentOS 5.4 VectorLinux 6.0
Posts: 5,132
Thanked: 464
You can just copy the files
Code:
/etc/skel/.bashrc
/etc/skel/.bash_profile
/etc/skel/.bash_logout
into your home directory. These are actually the files copied into new user's home, when it is created. The /etc/skel method appeared in the very first linux distributions and its purpose is to let the system administrator to add customization for all the users. He/she just modifies the "skeleton" files, being sure they are copied into the home of every newly created user.

This mechanism is also used from software other than bash. For example in Fedora 9 you will find hidden files and directory coming from libgnome, mozilla and zsh.

You can easily verify this behaviour by adding a test user and look at the hidden files placed in its home dir, but before doing the first graphical login (a process which adds many more hidden configuration files and directories).
linuxsuse colucix is offline     Reply With Quote
Old 11-06-2009, 03:00 PM   #5
colucix
Guru
 
Registered: Sep 2003
Location: Bologna, Italia
Distribution: OpenSUSE 11.1 CentOS 5.4 VectorLinux 6.0
Posts: 5,132
Thanked: 464
Quote:
Originally Posted by wisdom View Post
Never mind I have solved the issue all I had to do is copy the following files to my own home directory from another account.
Good. Just take in mind that by copying the .bash_history file, you inherit the bash history from another user. Indeed .bash_history is created (or updated if already there) upon closing a shell session. This process and its behaviour depends on some environment variables. See man bash and look for the HISTORY section for more details.
linuxsuse colucix is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 03:14 PM
showing only directorys from the command line djgerbavore Linux - Newbie 7 07-13-2005 09:34 PM
how do I set a path for my java command line tools darkone66669 Linux - Newbie 1 04-19-2004 07:28 PM
How to set the $PATH on command line? huangyanfeng Programming 3 11-07-2003 01:59 AM
Showing Distrobution in Command Line? dpaille Linux - General 12 11-24-2002 10:16 PM


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

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration