How to get list all user agents ordered by the number of times they appear from access.log

awk -F\" '{print $6}' access.log | sort | uniq -c | sort -bg

Response example:

...
  46547 Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
  89768 API/1.0 (+Legacy)
 104304 Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
 133439 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
 149988 Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)
 400785 Bad Bot
 45   3 mon  
Popular