I had a ton of aliases defined and I use them all the time. I have a terminal session open now in which all the aliases are valid and working. However, the .bash_aliases file in which they were defined has been deleted. How can I expand or recover my aliases from my terminal session?
1 Answer
Simply use the command alias
which prints out all definitions in a format bash
can read in again:
$ alias
alias second='again'
alias test='hello'
So to recover, simply use
$ alias > .bash_aliases
-
1
-
Do you have something special in mind? For example no problem with
alias weired='echo \\$hello'
.– mpyMar 1, 2013 at 21:03