.bash_profile file corrupted

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat .bash_profile file corrupted
# 1  
Old 02-21-2013
.bash_profile file corrupted

Hi,

Unexpectedly i entered wrong entries in .bash_profile for my user which has administrative permissions. So, i am getting errors for every command. I dont have backup file also, so any body can help me how to recover it.


Regards,
Mastan
# 2  
Old 02-21-2013
What errors are you getting? Maybe it's just the PATH that's wrong?
# 3  
Old 02-21-2013
Next time make a backup copy before you muck with it. Unix 101.

You ought to be able to copy a working default file from /etc/skel/ into your home directory, overwriting the broken file.
# 4  
Old 02-21-2013
A backup wouldn't help much if you don't have the ability to use the backup...

How do you login to root? If you do su instead of su - from another user, you should be able to login as root without reading root's profile, and work from there.
# 5  
Old 02-21-2013
Quote:
Originally Posted by Corona688
A backup wouldn't help much if you don't have the ability to use the backup...

How do you login to root? If you do su instead of su - from another user, you should be able to login as root without reading root's profile, and work from there.
Why wouldn't you have the ability to use it? Use root, or another user account + sudo, or even boot the machine using a bootable live CD and mount your home filesystem and move the file. Plenty of ways to skin this cat!
# 6  
Old 02-21-2013
We all have been in this boat. You have to manually do the most important things in your profile, like stty options and $PATH, $LD_LIBRARY_PATH, PS1. When you gat it fixed, make a copy called .bash_profile.YYYYMMDD for future reference.
# 7  
Old 02-24-2013
Thanks guys, issue got resolved by copying default .bash_profile from another system.

Rregars,
Mastan
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks, While transferring file from FTP software like Filezilla the files gets corrupted. Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary... (6 Replies)
Discussion started by: Khan28
6 Replies

2. Solaris

WTMPX File corrupted

Hi All I work on solaris 8, 9 and 10 platforms and have encountered an error which is my wtmpx files appear to be corrupted as all entries contain the date 1970 (the birth of unix). Now this is obviously not the case, so my query is: 1 - Can the existing wtmpx files be manipulated to... (6 Replies)
Discussion started by: drestarr96
6 Replies

3. Linux

How to add entry into .bash_profile file

Hi, Currently If i have created new userID then .bash_profile file is created under the new user. Now, I would like to add one path in this file. Please help on this . Current file output: # .bash_profile # Get the aliases and functions if ; then . ~/.bashrc fi #... (4 Replies)
Discussion started by: Mani_apr08
4 Replies

4. UNIX for Dummies Questions & Answers

may a corrupted .gz file be repaired?

Preparing for a move to a new server, I needed to offload about somewhat over a gigabyte of newsfeeds that my website collects, and that I had been saving on the server. I tarred them and zipped them into about a dozen smaller files of about 150Mb each. All seemed well. I downloaded them onto my... (3 Replies)
Discussion started by: JohnTinker
3 Replies

5. HP-UX

Could be a corrupted file?

Hello! Do you know the meaning of... "crw-rw---- 1 informix informix 64 0x020001 Jan 21 2004 rifxroot" I don't know what the first "c" means. Furthermor, if I try to copy this file (rifxroot) it appears a message: "cp: cannot open rifxroot: No such device or address" I don't... (1 Reply)
Discussion started by: kaugrs
1 Replies

6. UNIX for Dummies Questions & Answers

how to find a corrupted file in a directory

Hi, Dunno if this has already been discussed but can anyone tell me if there is any utility/command to find a corrupted file in an unix directory. With smile, karthik (1 Reply)
Discussion started by: skarthik_d
1 Replies

7. UNIX for Dummies Questions & Answers

Help! passwd file corrupted

Hi, I am new to UNIX, and have recently installed Suse 9.3. I have been experimenting with all of the commands and have somehow managed to modify the default shell of the root user to an invalid file. Consequently I cannot su to the root user as I receive the 'no such file or directory' error... (2 Replies)
Discussion started by: Tony Montana
2 Replies

8. HP-UX

passwd file corrupted

Good Day Our HP box was hacked and the passwd file has been altered,there are only 2 user accounts active,and these dont have any administrative rights.I need to edit the passwd file to correct the su and root entries. Does any body have any suggestions as to how i can do this with out the root... (10 Replies)
Discussion started by: cantona7
10 Replies

9. Shell Programming and Scripting

detecting corrupted file

Hello, Newbie question: How can I detect a corrupted file from a script (ksh)? Thank you, Martin (6 Replies)
Discussion started by: starless
6 Replies

10. UNIX for Dummies Questions & Answers

corrupted tar file

Hi all, I've got a corrupted tar file with some filename being like ?a=n is it possible to get them repaired? (1 Reply)
Discussion started by: klintsovi
1 Replies
Login or Register to Ask a Question