The difference between bacteria and viruses that show bacteria are living and not viruses is that viruses, unlike bacteria, lack what is considered a living organism. For Example, viruses cannot reproduce without the help of a host, and don't use the normal way of cell-division for replication. Unlike bacteria, which can reproduce without the aid of a host.
So basically viruses don't have what it need to be a living organism, like reproducing without and host and aren't in the norm for cell-division for replication.
Both flagella and pili are extensions from the bacterial cell body. Flagella are like a whip or a tail while pili are best described as hairlike.A pilus is a hairlike appendage found on the surface of many bacteria.