The calculated distance (air line) between Tripoli and Bani Walid is approximately 92 miles respectively 147 kilometers.
By car or train, the actual journey to Bani Walid is certainly longer, as only the direct route (as the crow flies) between Tripoli and Bani Walid has been calculated here.
Air line (approximately)
147 kilometers
80 nautical miles