6

I was working with a program and it deleted my .bash_profile, which I unfortunately haven't backed up for several months. I however, have one terminal open that I am not going to close which has the file loaded in.

Is there any possible way I can "export" the loaded bash aliases etc from the current terminal?

3 Answers 3

5
alias > my_aliases 

can give you some aliases back, but if you have hundreds, you probably want to use comm(1) to identify which ones are in another file.

Sign up to request clarification or add additional context in comments.

Comments

5
declare 

will dump out all variables and functions in your current shell. (So will set.)

Comments

3

You can get at least some of it with the env command:

env >template_bash_profile 

And then work from that.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.