Help - Search - Members - Calendar
Full Version: New to linux
Linuxhelp > Support > Technical Support
DaveUK
First post on here although it may not be my last with the current situation I've found my self in.

I work for a small company and we run a Linux box with samba and a basic intranet website used for taking bookings (over the phone).

Now as i say we are very small and don't have a i.t. department or any i.t. staff as such, we was lucky that we had someone working for us previously who setup the Linux box and who looked after it. Now he has left i seem to have taken over his role.

I am very new to Linux but i am a quick learner and would like to get into Linux.

OK I've given my background which i hope will help you understand my situation and hopefully stop you thinking "who gave that idiot root access?" I'll get onto my problem.

Since i took over I've been having a clear out of old files we never use (documents etc) some of which we couldn't delete via the samba windows shares from my windows machine so i had to log into the box via SSH and remove the files using a command like "rm -rf oldfile.doc" which was all fine.

Until i found another file which we couldn't delete (most of these files are from previous employee's which I'm guessing i cant delete because the files are owned by another user) using the above command i managed to delete the file just fine but did notice the command line changed. It didn't change when i did the command it must of been like that when i logged in but its not as it normally would be.

Normally the command line would be something like:
root@localhost ~# <- when in my home space
root@localhost /var/www/htdocs# <- when in the web space folder

But now it just shows:
-bash-3.00#

The shell still works as it should but this is very annoying because if i alt tab to another application and then go back to the shell i find i will of forgot what directory i am in, I've tried restarting SSHD and restarting the server.

To my knowledge no one else has changed anything and i haven't changed anything other than deleting a few documents.

Please can anyone help me get my normal command prompt back as default?!?

Server specs:
CentOS 4.4
2.66Ghz Celeron
1Gb Ram
2x 160Gb HD RAID setup.

I'm Connecting via SSH using PUTTY.

UPDATE:

A friend suggested i might not be logged on as root and suggested i typed "su root" to switch user, even though i was 10000% sure i was logged on as root i thought worth a try! would you believe it my normal command prompt came back!

If i disconnect from ssh and reconnect it still takes me to the dodgy command prompt and i have to SU.

Thanks in advanced and sorry for the essay!

- Dave.
michaelk
Global configuration for all users are in the file /etc/profile. The default bash prompt will be something like:
PS1="\u@\h \W\\$
Which gives you the familar user@hostname$ prompt.

Each user in their home directory has a hidden file called .bash_profile where one can individualize their environment settings.

Have you deleted any files in the /etc directory?

What happens when you log on to the server itself instead of using putty?
DaveUK
QUOTE (michaelk @ Nov 16 2006, 02:02 AM) *
Global configuration for all users are in the file /etc/profile. The default bash prompt will be something like:
PS1="\u@\h \W\\$
Which gives you the familar user@hostname$ prompt.

Each user in their home directory has a hidden file called .bash_profile where one can individualize their environment settings.

Have you deleted any files in the /etc directory?

What happens when you log on to the server itself instead of using putty?


Thanks for the quick reply!

I seem to be missing a .bash_profile?!?! i was deleting some files from the users root home dir and i may of accidentally deleted the file unsure.gif

If definitely gone... "ls -a"

How can i restore/rewrite the file?

TIA
michaelk
You can copy it from another user. undeleting can be a little more difficult and depends on the filesystem. I assume you would be using ext3. You would need to remount the filesystem to ext2 and then use one of the several ext2 undelete utilities. Not knowing how your system is partitioned I suggest using a liveCD.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.