Eu escrevi este script: #!/bin/bash while [ true ] do currentoutput="$(lsusb)" if [ "$currentoutput" != "$lastoutput" ] then echo "" date and Time >> test.log date +%x_r >> test.log lastoutput="$(lsusb)" lsusb >> test.log fi sleep 5 done Sou novato tentando aprender...