1

Running Ubuntu 14.04 LTS

I open a terminal, and type a simple alias command, but then it doesn't work:

~> alias ge='gedit &'
~> ge
ge: command not found

I've also tried adding aliases to .bashrc, .profile, .bash_aliases, all to no avail. What is most disturbing is that it doesn't work in command line.

Additional things, in response to comments:

    > alias ge='gedit &'
    > ge
    ge: Command not found.
    > alias
    >
    > echo $-
    Illegal variable name.
    > shopt -p expand_aliases
    shopt: Command not found.

    > . ~/.bashrc
    /usr/sbin/.: Permission denied.
    > source ~/.bashrc
    Illegal variable name.
A.B.
  • 92,125

3 Answers3

3

You can also edit your ~/.tcshrc file when using tcsh instead of bash to set a persistent alias:

echo 'alias ge "gedit &"' | tee -a ~/.tcshrc

Then, source the file and ge should open gedit:

source ~/.tcshrc
mchid
  • 44,904
  • 8
  • 102
  • 162
3

Because you use tcsh instead of bash, your alias definition is wrong. Define an alias in tcsh via

alias ge gedit 

or

alias ge 'gedit &'
A.B.
  • 92,125
0

Answer: My shells were running tcsh. I had to switch this to bash. I realized this after accidentally just typing "bash" on the command line, and this made everything work (aliases, bashrc, etc.) All the problems above were due to simply not having bash running.