Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

And with it all my class paths, env vars and aliases. Is this something that can be recovered?

share|improve this question

migrated from Jan 14 '11 at 13:56

This question came from our site for professional and enthusiast programmers.

From a backup perhaps? Is it in the trash? If not, then probably it's gone unless you spun the disk down right away after deletion. – martin clayton Jan 14 '11 at 13:55

If you have a backup (like Time Capsule), you can recover the file.

share|improve this answer

On a Side note. Using .profile is not the best option. Using .bash_profile or .bashrc is much better for you in the long run.

Place this in .bash_profile or .bashrc and place your exports, functions and aliases in the following.

if [ -f ~/.bash_exports ]; then . ~/.bash_exports ; fi
if [ -f ~/.bash_functions ]; then . ~/.bash_functions ; fi
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases ; fi

Place this function which Backs up .bash* files in you .bash_functions and all you have to do us run backup_bashfile in the terminal and there we go.

function backup_bashfiles()
   ARCHIVE="$HOME/bash_dotfiles_$(date +%Y%m%d_%H%M%S).tar.gz";
   cd ~
   tar -czvf $ARCHIVE .bash_profile .bashrc .bash_functions .bash_aliases .bash_prompt
   echo "All backed up in $ARCHIVE";

Using Time Machine is a great solution yet get you bashes in the right place and back them up, they will be with you for a long time.

share|improve this answer

You must log in to answer this question.