Queries module state and prints that rewrite is enabled or that no such module is found. The exit status also reflects the answer, so scripts can branch on it. Use a2query -s example.com to check a site instead, or a2query -v for the Apache version.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.