1

Every time I run audacious from terminal, I have to type this: audacious my_song.mp3 >& /dev/null &

Is there an alias for this, so that if I only type audacious my_song.mp3 it will become audacious my_song.mp3 >& /dev/null &.

P/S: & is to make audacious run in background and >& /dev/null is to ignore some infomation from stdout and stderr.


My short answer:

$ cd # to go to home directory
$ # make directory where you save your aliases
$ mkdir alias.d && cd alias.d
$ cat << EOF > audacious.sh
#!/bin/bash
audacious "$@" > /dev/null 2>&1 &
EOF
$ chmod u+x audacious.sh
$ cd # to go to home directory
$ echo "alias audacious='~/alias.d/audacious.sh'" >> .bash_aliases
$ source .bash_aliases # make sure your .bashrc source .bash_aliases
mja
  • 998

0 Answers0