Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

As anubhava saysanubhava says, your

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ; ls -lh;"

command is failing because you’re not allowed to have & followed immediately by ;.  You can see this just by typing the commands directly into the shell:

  • true & true  works
  • true & ; true doesn’t work

If you want the tcpdump command to run in the background, remove the ;, as in

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ls -lh;"

(and you don't need the ; at the end, either, but it doesn’t hurt).

As anubhava says, your

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ; ls -lh;"

command is failing because you’re not allowed to have & followed immediately by ;.  You can see this just by typing the commands directly into the shell:

  • true & true  works
  • true & ; true doesn’t work

If you want the tcpdump command to run in the background, remove the ;, as in

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ls -lh;"

(and you don't need the ; at the end, either, but it doesn’t hurt).

As anubhava says, your

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ; ls -lh;"

command is failing because you’re not allowed to have & followed immediately by ;.  You can see this just by typing the commands directly into the shell:

  • true & true  works
  • true & ; true doesn’t work

If you want the tcpdump command to run in the background, remove the ;, as in

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ls -lh;"

(and you don't need the ; at the end, either, but it doesn’t hurt).

Source Link

As anubhava says, your

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ; ls -lh;"

command is failing because you’re not allowed to have & followed immediately by ;.  You can see this just by typing the commands directly into the shell:

  • true & true  works
  • true & ; true doesn’t work

If you want the tcpdump command to run in the background, remove the ;, as in

su root -c "tcpdump -i wlan0 -s 1500 -w CCCCCC & ls -lh;"

(and you don't need the ; at the end, either, but it doesn’t hurt).