2

I messed up a .profile and now I can't even get nano to work.

I was trying to add git to my environment variable whenever I start terminal, and I messed the command up obviously and no nothing works.

Not even the ls command works.

Where is nano so I can edit the file?

What should a standard .profile look like?

1
  • Next time you should back up sensitive files before you edit them ;) I don't have a complete enough answer to throw in the answer section, but I would recommend creating a new user account and using that user's .profile as a "standard" .profile to see what you may have done wrong in your edits or at least restore what you had before.
    – Emory Bell
    Jun 5, 2010 at 3:02

3 Answers 3

2

You should still be able to use the full path to run commands. For example:

/bin/ls

/bin/nano

I'm not sure where ls is on a mac... it might be under /usr/bin/ls

I'm using Ubuntu 10.04. My .profile file in my home directory looks like this:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

Worth a shot i guess.

1
  • Glad it worked out (-:
    – James T
    Jun 5, 2010 at 3:48
0

Where is this .profile you messed up? I have a .bash_profile, but no .profile file.

2
0

Does the GUI still function (Finder, Desktop, Dock, etc.)? If so, Open the .profile file in TextEdit and replace the ; with a : (you might have to turn on hidden files or type the name manually into the open file dialog)

If your GUI is no longer functioning, reboot the computer and hold Command+S as it reboots. This should dump you at a command line with root access. Use nano to fix your .profile file.

You must log in to answer this question.

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