Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 '10 at 3:02
add comment

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
thanks a bundle! –  user27449 Jun 5 '10 at 3:38
    
Glad it worked out (-: –  James T Jun 5 '10 at 3:48
add comment

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

share|improve this answer
    
i created the following these directsion, but I put a ';' instead of a ':' in the line near the '$PATH' part. grasshopperpebbles.com/mac/installing-git-on-mac-os-x –  user27449 Jun 5 '10 at 3:01
    
its in my 'home' folder, i.e.: cd ~ –  user27449 Jun 5 '10 at 3:01
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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