2

This question already has an answer here:

I created the file ~/.bash_aliases within these lines:

# my alias here

eclipse="eclipse</dev/null &>/dev/null &"
okular="okular</dev/null &>/dev/null &"
libre="libreoffice</dev/null &>/dev/null &"

My ~/.bashrc is ready to find aliases:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

I then executed . ~/.basharc and also source .bashrc but aliases I created still don't work.

marked as duplicate by David Foerster, karel, Community Mar 17 '18 at 13:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Maybe because you are missing the alias in front of each line. What you are defining now is variables, not aliases. – Soren A Mar 17 '18 at 11:35
  • @SorenA I can't believe... thanks. – glc78 Mar 17 '18 at 11:38
4

You have defined plain variables, not aliases.

The alias definitions in bash must start with the keyword alias, so make the definitions as:

alias eclipse="eclipse </dev/null &>/dev/null &"
alias okular="okular </dev/null &>/dev/null &"
alias libre="libreoffice </dev/null &>/dev/null &"
  • Yes, sorry but I founded an example onile that omitted alias for some reason and I replicated it without thinking. It's clear now. – glc78 Mar 17 '18 at 12:31
  • @Glk-78 Now you've found a very good reason to avoid random technical articles on the internet. – heemayl Mar 18 '18 at 8:00
  • True, but I also paid few attention. Maybe at the lines above there was somekind of explenation I didn't see. – glc78 Mar 18 '18 at 11:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.