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