How to disable an activity containing a special character? What is the correct way to disable the activity:

com.android.settings/.Settings$SystemDashboardActivity


When I try to disable it via pm disable command it disables the whole Settings activity and not the specific activity SystemDashboardActivity.

Note: I have a rooted device.
You need to escape the dollar character. Otherwise, the shell would interpret  anything after $ as the variable name. Since $SystemDashboardActivity as a variable is not set, your command is effectively interpreted as:

pm disable com.android.settings/.Settings


That naturally would disable the parent (.Settings) component.

Escape $ by prefixing it with \ so as to prevent unwanted interpretation from shell.  Your command should look like this:

pm disable com.android.settings/.Settings\$SystemDashboardActivity


Tested on Android 9.0 running on OnePlus 6. Make sure to run the command as root.