you should connect to your SQL server using SQL root login,
#mysql -u root -p
then execute command in SQL console (172 was used as example)
mysql>PURGE BINARY LOGS TO ‘mysql-bin.172’;
then leave SQL console
mysql>exit
If you disable binary logging, yes, you can delete this files with rm command when MySQL stopped