You can run on-demand scans via Terminal, Mac OS X's command line interface. This article provides common sweep commands and what they do.
Applies to the following Sophos product(s) and version(s)
Sophos Anti-Virus for Mac OS X
Mac OS X
From Spotlight type 'Terminal' and press enter. Example:
The full usage can be displayed in Terminal by running the command:
The minimum parameters to run a sweep scan is a path to scan (e.g., '
sweep ~' to call the program and scan the current user's home folder). Certain parameters are included by default, without needing to include them. Therefore running sweep with just a path parameter and no other options includes the following settings:
-sc : Scan dynamically compressed executables
-s : Run silently (do not list files swept)
-c : Ask for confirmation before disinfection/deletion
-b : Sound bell on virus detection
-all : Scan all files
-rec : Do recursive scan
Note: Any option (such as those listed above) can be prefixed with 'n' to invert their meaning (for example,
-nsc is the inverse of
Common sweep parameters examples are show below.
Example usage options
The table below shows some of the more common commands you may want to use.
|I want to... ||Command |
|Scan the current user's home folder and take no action || |
|Scan the main local drive and take no action against threats. || |
sudo sweep /
|Scan the current user's Downloads folder, include all archive (compressed) files in the scan, and take no action against threats. || |
sweep -archive ~/Downloads
|Scan the main local drive, include PUA (Potentially Unwanted Application) scanning, and take no action. || |
sudo sweep -pua /
|Scan the main local drive, take no action against threats, log to a file on the desktop of the current user, and write out all of the file names scanned. || |
sudo sweep -ns -p=/Users/aUser/Desktop/sweep.log /
|Scan the main local drive, take no action against threats, log the current file being scanned with timestamps. || |
sudo sweep / -dn 2> ~/Desktop/sweep.log
|Scan the current user's home folder, log scan, and disinfect infected items found (remove - if possible - the infected bit of an otherwise valid file from the original). || |
sweep -di -p=/Users/aUser/Desktop/sweep.log ~
|Scan the current user's home folder, log the scan, and delete infected items found. Use with caution. || |
sweep -remove -p=/Users/aUser/Desktop/sweep.log ~
Warning: Use the sudo command with care. If you attempt to 'remove' or 'disinfect' system files your computer's operating system may experience problems. If using sudo to scan the whole drive we recommend logging the results and reviewing the log afterwards for item that may need action taking against them.