SAV for Mac: Using Sophos Anti-Virus via Terminal

  • ID de l'article 12178
  • Mis à jour : 08 avr. 2014

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

Operating systems
Mac OS X

Open Terminal

From Spotlight type 'Terminal' and press enter.  Example:

Usage options

The full usage can be displayed in Terminal by running the command:

sweep -help

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:

  1. -sc : Scan dynamically compressed executables
  2. -s : Run silently (do not list files swept)
  3. -c : Ask for confirmation before disinfection/deletion
  4. -b : Sound bell on virus detection
  5. -all : Scan all files
  6. -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 -sc).

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 sweep ~
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.

 

 
Si vous avez besoin de plus d'informations ou d'instructions, veuillez contacter le support technique.

Évaluez cet article

Très mauvais Excellent

Commentaires