0

I've changed my .profile file and added to the end:

Export PATH = "bin/somepathToMatLab"

This resulted after a restart, that when I login with the GUI it loops right back to the login page. I then logged in with CTRL-ALT-F1 and landed in my home directory but was unable to use "vi" to open or "cp" to copy anything because of the change to the top mentioned path.

Please help me to reset the .profile .

2
/usr/bin/vi .profile

Replace

Export PATH = "bin/somepathToMatLab"

With

export PATH=$PATH:"bin/somepathToMatLab"
2
  • When i try to use "sudo vi .profile" it says : "The command could not be found, because 》/usr/bin《 is not part of the environment variable PATH. sudo: Comand not found."
    – Kokonut
    Aug 14 '17 at 12:43
  • @Kokonut did you try the command /usr/bin/vi .profile exactly as posted? there should be no need to use sudo to edit your own files such as .profile in your own home directory Aug 14 '17 at 13:41
1

Do

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

and change the line in your .profile file to

export PATH=$PATH:/bin/somepathToMatLab

Then logout and login again.

1
  • When i try to use "sudo vi .profile" it says : "The command could not be found, because 》/usr/bin《 is not part of the environment variable PATH. sudo: Comand not found."
    – Kokonut
    Aug 14 '17 at 12:42
0

It should have been:

export PATH="$PATH:bin/somepathToMatLab"

otherwise it resets the initial PATH variable and the system can't find any of your programmes.

PS: to edit log in as root

5
  • root is normally disabled in Ubuntu. The correct way is to use sudo vi .profile
    – Soren A
    Aug 14 '17 at 12:21
  • True, sorry! I like to re-enable it. Aug 14 '17 at 12:22
  • When i try to use "sudo vi .profile" it says : "The command could not be found, because 》/usr/bin《 is not part of the environment variable PATH. sudo: Comand not found."
    – Kokonut
    Aug 14 '17 at 12:39
  • as the people above suggested, use /usr/bin/vi for vi and /usr/bin/sudo for sudo Aug 14 '17 at 12:43
  • so /usr/bin/sudo /usr/bin/vi .profile Aug 14 '17 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.