Install sqlcmd if not already installed using below command.

$ sudo apt install sqlcmd

Then, use below command to connect to SQL Server

$ sqlcmd -S sqlservernamedinstance -U username
Replace sqlservernamedinstance with your actual instance name. Replace username with actual username. Once it asks for the password, please type password then you will be connected to the sql server.