Hi,
You may connect with below commands:
Using windows authentication:
sqlcmd -S servername/instancename -E
or SQL server authentication:
sqlcmd -S servername/instancename -U Username -P Password
Further you may take help from :https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-2017&tabs=go%2Cwindows&pivots=cs1-bash