Run the following command to find the list of dotnet sdks installed on your machine:
dotnet --list-sdks
The command will output all the sdks installed:
6.0.201 [/usr/local/share/dotnet/sdk]
6.0.202 [/usr/local/share/dotnet/sdk]
6.0.300 [/usr/local/share/dotnet/sdk]
6.0.301 [/usr/local/share/dotnet/sdk]
6.0.302 [/usr/local/share/dotnet/sdk]
6.0.400-preview.22330.6 [/usr/local/share/dotnet/sdk]
6.0.400 [/usr/local/share/dotnet/sdk]
6.0.401 [/usr/local/share/dotnet/sdk]
7.0.100-rc.1.22431.12 [/usr/local/share/dotnet/sdk]