Multiple commands on a single line in Linux

Viewed 8470

I'd like to run several commands on the command line.

In a normal case this is simple:

#cd /home && ls && echo "OK"
root   web   support
OK

However when one of the commands ends itself on a & this doesn't seem to work:

#killall vsftpd && /usr/sbin/vsftpd & && echo "OK"
-sh: syntax error: unexpected "&&"
OK

I've tried without the single trailing & but this obviously halts the processing of the latter echo. Just for fun tried a triple & but this also returns an error.

So my question; how can I get

killall vsftpd
/usr/sbin/vsftpd &
echo "OK"

executed on one single line?

2 Answers
Related