/etc/profile file edited. No command working


 
Thread Tools Search this Thread
Operating Systems Solaris /etc/profile file edited. No command working
# 1  
Old 12-19-2008
/etc/profile file edited. No command working

I have X4500 and I created a user. I wanted to give him root privileges and for editing the sudoers files I typed visudo sudoers. But it said visudo command not found. After googling I found that we need to set path in etc/profile. I edited that and put the following command

PATH=usr/local/sbin:usr/local/bin

and export PATH.

I already had some PATH above what I mentioned and now I can't use any command. ls -a, cat, everything says command not found. It seems that the PATH has changed and its unable to access these commands. I cannot even have access to GUI to correct it. Please help me with this in some way.

Thank you.
# 2  
Old 12-19-2008
You are missing the leading "/" in your path entries.
# 3  
Old 12-19-2008
Also, you need to add more directories to your path, for example /bin , /usr/bin and /usr/sbin

In addition, you should never edit a file like this with making a backup copy first,
# 4  
Old 12-21-2008
I'd suggest adding the path statement to your user's profile (in his/hers home directory), rather than adding it to /etc/profile as /etc/profile updates everybodies path statement. This way, if you make a mistake you're only going to affect a single user rather than the problem being system wide and affecting all users. And not everybody needs to use visudo, so making it a little harder to run is probably worthwhile.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Notepad++ hang when open file edited in other text editor

Hi, I would like to ask about the notepad++ text editor application, Although there are alternative and more great text editor in linux (gedit, geany, jedit) im still using the notepad++ sometimes cause for some of my own reason one of those is the minimalist text(what i mean is notepad++ has a... (2 Replies)
Discussion started by: jao_madn
2 Replies

2. Shell Programming and Scripting

How to read a file name that was recently edited when listed using ls command?

I was trying to write a script that will process recently creatd file. From below, the script should process input_20111230.dat file. sam:/top/work/data/input: ls -ltr input_*.dat -rw-rw-rw- 1 work edprod 455668 Dec 24 09:16 input_20111224.dat -rw-r--r-- 1 work edprod ... (7 Replies)
Discussion started by: siteregsam
7 Replies

3. UNIX for Advanced & Expert Users

Who edited my text file?

I was editing my text file in gvim & I was getting message that its changed & to load again. I work in a workplace environment with everyone having there username.. How can I know that who edited my file? (4 Replies)
Discussion started by: krishanu
4 Replies

4. Solaris

The .profile file has only exit command

Hi everyone, This is my first post in the forum. :-) I was asked this question for an interview recently. Q: What will happen if the .profile file has only the exit command in it and nothing else. (Assume that every other settings are in place to run the .profile file, when the user... (6 Replies)
Discussion started by: avinashpv
6 Replies

5. UNIX for Advanced & Expert Users

user .profile file not working

Hi All, I tried creating a .profile file but it is not working even after exiting the session. But before that I will give a quick background. I log into UNIX(SUN - ksh) and then SUDO to another user. After that I change DIRECTORY. In this DIRECTORY I tried creating the profile file but it... (4 Replies)
Discussion started by: sumeet
4 Replies

6. Solaris

After giving Bash the .profile settings are not working

I am using Solaris ... I have some settings in my .profile and in .profile iam calling some scripts. After i logged in to that box if i gave "bash" and proceed with my shorcuts(alias) are not working . (3 Replies)
Discussion started by: girija
3 Replies

7. UNIX for Dummies Questions & Answers

Saving file edited whith sed

HI! I have a file that looks like this: >ANKRD30_2kb AAGTAACCAATGCAGGAAACCGAGAGGAGAGGTTTGGAAGGTGGTTTAGTGAGGTAATCCATCTTTTCT AGTGATAAACTGGCACCCAGTCAATTTATTCATCAGAAGGGAATACATCAGCCTGGCGTGGTGGCTCGC CCCCGACCCTGTCAGCGTCACCAGCAGCGCGGATCCATGGGCCAGAAGCCTCTAGGGCGCCTAAGTCAG Number of residues in the... (9 Replies)
Discussion started by: vanesa1230
9 Replies

8. UNIX for Advanced & Expert Users

commands after .profile modification not working

Hi , I have modified .profile and after that i ran it as .profile. Now no command i working even ls is not working When i type ls , it is showing that -ksh not found I tried to run as . $home/.profile , it is saying as permission denied . How can we do that .. any idea.. Thanks... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

9. Shell Programming and Scripting

Logon profile kill script only partially working

I have been having an issue with the new motorola rf scan guns opening up too many sessions at once. It seems they will open a new connection for no reason, leaving the old one in the background and the user has no idea it is happening. To combat this, I have added the following code to the logon... (1 Reply)
Discussion started by: raidzero
1 Replies

10. UNIX for Dummies Questions & Answers

Edited Path in Profile File

Definitely a unix dummy. I edited the paths in the /etc/profile file - following the instructions on an install package. Now can't use vi, cat pg ls or any other unix commands. Guess I'm in big trouble. Path reads MANPATH=/opt/hpnp/man PATH=/opt/hpnpl/bin LD_LIBRARY_PATH=/opt/hpnp/lib ... (4 Replies)
Discussion started by: thewetch
4 Replies
Login or Register to Ask a Question