Ubuntu clears Alias after closing the terminal's window

0

When I defined some aliases on Ubuntu vivid(15.04) via the terminal, it clears all aliases after I close the window. What can the problem be?

makgun

Posted 2015-06-04T22:02:26.050

Reputation: 305

1If you want a permanent alias, you need to put them in ~/.bash_aliases in form of e.g. alias install='sudo apt-get install'. – pileofrocks – 2015-06-04T22:38:38.367

There is no bash.aliases on my home directory And I dont know how to add command with starts "if" and finishes"fi" for aliases. – makgun – 2015-06-04T22:57:46.533

Just create the file then. 2nd question: bash scripts? – pileofrocks – 2015-06-05T02:47:29.420

I tried to create the file and then again I defined some aliases via the terminal but it doesnt work – makgun – 2015-06-05T09:15:44.590

Not via the terminal, but write/add them to the file. – pileofrocks – 2015-06-05T18:01:28.713

which format I need to use? For there are something looks like this

enable color support of ls and also add handy aliases

if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

fi – makgun – 2015-06-05T19:35:16.843

I added some alias command to this file and after that I restart the terminal but it doesnt work. Even I restart the Laptop but the result is same – makgun – 2015-06-05T19:37:46.737

Yeah! Finally I got it. Thanks All of you! I just typed wrongly /.bash.aliases instead of /.bash_aliases. – makgun – 2015-06-05T20:59:16.733

Answers

3

There is no problem. It works as intended.

You set up a temporary alias. You exit the shell. The temporary alias is gone like the evening wind.

Hennes

Posted 2015-06-04T22:02:26.050

Reputation: 60 739