USB connection with +5Volts

Hello, i want to know if i can power my arduinos (Mega and Leonardo) with USB connection but with a 9V battery. Can you guys help me?

(deleted)

I think I expressed myself wrong, i want to know if i can connect the 9V battery to the usb cable, and use it to power the board, without serial connection

(deleted)

Thanks man! :wink: