To check if the SMB service (file sharing) is running on your Mac from the Terminal,
use the launchctl list command and filter for smbd:
bash
sudo launchctl list | grep smbd
Interpreting the Output
- Service is running: If the command returns a line containing
com.apple.smbd, the service is loaded and likely running. The output will also show a status code, typically0if it is running successfully. - Service is not running: If the command does not return any lines, or the status code is non-zero, the service is not currently active.
Alternative Check: Active Connections
You can also check for active SMB network connections,
which indicates the client is at least trying to use SMB:
- View active connections and SMB version:
Use the following command to list details about current SMB connections, including the protocol version being used:
<code>sudo netstat -tulnp | grep ":445"
- Check for port 445 activity (SMB port):
This checks if the SMB port is open and being used on your Mac:
<code>smbutil statshares -a
Graphical User Interface (GUI) Method:
For a non-terminal method, you can check the status in System Settings:
- Open System Settings (or System Preferences on older macOS versions).
- Navigate to General > Sharing.
- Look at the toggle switch next to File Sharing. If it is on, file sharing (including SMB) is enabled.
- Click the information icon (i) next to File Sharing, then click Options to verify that “Share files and folders using SMB” is specifically checked.
