Ubuntu 14.04 get stuck when trying to login my desktop. The screen goes black and soon after that the login screen bounce back.

Actually i added a line in /.profile file in last boot-up export PATH= .:$PATH and during next boot, it started to enter in loop.

login into tty1 showing

-bash: export: '.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/home/mohammad/android-sdk-linux/platform-tools:/home/mohammad/android-sdk-linux/tools' : not a valid identifier

entering any command in tty1 showing

-bash:<command name> : NO such file or directory
  • 1
    just boot in recovery mode and do cp /etc/skel/.profile /home/username/.profile where username is your username
    – Zanna
    Dec 16, 2016 at 18:30
  • yes so mount -o remount,rw /
    – Zanna
    Dec 16, 2016 at 18:58
  • @Zanna, this didn't help Dec 16, 2016 at 19:20
  • @Zanna actually the whole process didn't help Dec 16, 2016 at 19:28
  • you replaced username with your actual username in the command and rebooted right? and you still get the same error?
    – Zanna
    Dec 16, 2016 at 19:45

1 Answer 1


I'm guessing you wanted to be able to run commands in your current working directory without typing the prepending ./? Oh well, this is still fixable.

You've only messed up your own user profile, so we can use the root account to repair this damage. First off, you're going to want to boot into recovery mode on your system. From there, select the option that says root, which will drop you into a usable terminal.

From there, you want to cd to your user's home folder (/home/<your username>, the ~ shortcut will not work here). From there, edit your .profile file with something like nano or vi. Delete the line containing:

export PATH= .:$PATH

Be sure to also check .bashrc, .bash_profile and similar files just to be sure. Remove the same line there (if they exist).

If you do want to try this again, be careful to not include spaces in the profile, and be sure to add the . to the end, like so:

export PATH="$PATH":.
  • nano .profile creates a new file instead of opening old one Dec 16, 2016 at 18:37
  • @TheBlueMagician Did you actually cd to your home folder first?
    – Kaz Wolfe
    Dec 16, 2016 at 18:38
  • yeah, i cd to home directory root@blue:/home/mohammad# nano .profile Dec 16, 2016 at 18:42
  • using vi when i tried to open, it showig e303 unable to open swap file for ".profile", recovery impossible Dec 16, 2016 at 18:54
  • @TheBlueMagician Are you sure it was in just .profile and not something like .bash_profile? Does ll | grep profile show the file?
    – Kaz Wolfe
    Dec 16, 2016 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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