I'm running hostapd on my raspberry PI to let it function as an accesspoint. It's working fine with the following command:

sudo hostapd /etc/hostapd/hostapd.conf

This will start hostapd and log all output to the console. Now I want to log this output using TEE or pipe. However, one the following commands will cause the program not to start.

sudo hostapd /etc/hostapd/hostapd.conf >> /home/pi/Desktop/loggin.txt sudo hostapd /etc/hostapd/hostapd.conf > /home/pi/Desktop/loggin.txt sudo hostapd /etc/hostapd/hostapd.conf | tee log.txt

The terminal will just hang and I have to use ctrl-x to terminate. Why isn't this working? And how can I possibly fix this?

  • 1
    does sudo anything work that way? It should, but different sudo configs might not allow that if the terminal is not their outfile. And are you sure it is just hanging and not actually working?
    – mikeserv
    Dec 1, 2014 at 16:22
  • 1
    What makes you think that the program isn't started? If it's only because you don't see any output, this could be because the program is executing normally, but its output is buffered, so the output appears only in relatively large chunks. Try unbuffer: sudo unbuffer /etc/hostapd/hostapd.conf | tee log.txt, do you see output now? Dec 2, 2014 at 15:12
  • It was actually running, but not working properly. However, I fixed it using the link @Gilles gave :)
    – swennemen
    Dec 9, 2014 at 19:54

1 Answer 1


The command that made it work is:

sudo stdbuf -i0 -o0 -e0 hostapd /etc/hostapd/hostapd.conf | tee log.txt

Not the answer you're looking for? Browse other questions tagged .