0

I made some mistake in my .profile during adding some path, now I can't login into my account. All i can do is enter terminal ctrl+alt+f3 and login there. How can I edit from there this file and make everything back to niemal?

4
  • You can use vi editor. Google using vi editor
    – FedKad
    May 18, 2019 at 15:21
  • Use a non-graphic editor, vi, vim, ed, nano. You will have to read the man page first. Or see if the editor you used left a backup file ~/.profile~.
    – waltinator
    May 18, 2019 at 15:23
  • I cant use command vi or even simple ls, it shows error that this command is in /bin and /bin is not in the PATH
    – Emil Majer
    May 18, 2019 at 15:28
  • I found solution, I added bin to path by typing export PATH=/usr/bin:/bin then I can use vim.
    – Emil Majer
    May 18, 2019 at 15:42

1 Answer 1

2

There are CLI editors available in Ubuntu:

If you're unable to simply call nano or vi you can try with absolute paths:

/bin/nano .profile

or

/usr/bin/vi .profile

And if you want to bring the default .profile back you can use the template from /etc/skel/.profile

/bin/cp /etc/skel/.profile /home/yourname/.profile

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .