I am trying to create an alias and I have added these lines in ~/.bash_aliases
alias server-python='open http://localhost:8000 && python -m SimpleHTTPServer'
alias ssh-saad='ssh saad@<my-server>' <my-server> is replaced by the ip add of my server. So in my ~/.bashrc file these lines are uncommented
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
and in my ~/.profile
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
so I believe whenever I start the terminal my aliases should work but unless I run this command source ~/.bash_aliases its not working. Also for the 1st server-python alias I am getting an error
"Couldn't get a file descriptor referring to the console "
I have looked into these solutions here
How to create a permanent "alias"?
Ubuntu alias not applied in bashrc
but still cannot make it work. I would really appreciate if someone could point me out what I am doing wrong. I know the problem is very trivial, but I must be just missing something. Thanks in advance.
EDIT
ok now I know why I am getting this error
"Couldn't get a file descriptor referring to the console "
I should have used alias server-python='sensible-browser http://localhost:8000 && python -m SimpleHTTPServer'
I should have used sensible-browser instead of open.
alias name='commands' somethingThe something part shouldn't work. – NotFromBrooklyn Dec 13 '12 at 13:19