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
audacious
, which must be done before the&
, you have to use functions instead. – muru Feb 13 '17 at 03:51&>
or2>&1 > /dev/null
instead of>&
– Sergiy Kolodyazhnyy Feb 13 '17 at 03:55foo () { /usr/bin/audacious "$@" > /dev/null 2>&1 & }
– mja Feb 13 '17 at 03:56