Author Topic: Scan File by Terminal Command?  (Read 1363 times)

0 Members and 1 Guest are viewing this topic.

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Scan File by Terminal Command?
« on: November 12, 2020, 07:56:58 PM »
Hi all,

I currently have the free version of Avast and was wondering if it supports scanning a targeted file via terminal command? If so, can someone point me to the commands?

Thank you,
Jon :)

Offline ondrej.kolacek

  • Avast team
  • Sr. Member
  • *
  • Posts: 306
Re: Scan File by Terminal Command?
« Reply #1 on: November 13, 2020, 09:03:17 AM »
Hello,
you can use 'scan' command; see 'man scan'
Kind regards,
Ondrej Kolacek

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #2 on: November 13, 2020, 03:25:50 PM »
Hi Ondrej,

Thank you for your reply. I'm sorry to say that I don't understand your answer. I did try opening terminal and typing 'man scan' but the information the showed didn't seem to be related to Avast.

Thank you,
Jon

Offline ondrej.kolacek

  • Avast team
  • Sr. Member
  • *
  • Posts: 306
Re: Scan File by Terminal Command?
« Reply #3 on: November 16, 2020, 09:04:29 AM »
Hello,
we install manual pages of scan command; maybe something else does it also. This should display it:
man /Applications/Avast.app/Contents/Backend/doc/scan.1
regarding the scan binary, we install a link to
/usr/local/bin/scan
but the binary is at
/Applications/Avast.app/Contents/Backend/utils/scan
you can run this for help:
/Applications/Avast.app/Contents/Backend/utils/scan -h
Kind regards,
Ondrej Kolacek

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #4 on: November 19, 2020, 06:50:11 PM »
Hi Ondrej,

Again, thank you for your reply. After trying to make sense of this, I still don't understand (I'm a newbie at this).

Can you please provide the full command to scan a file that is, let's say, on the desktop of the Mac?

Thank you,
Jon

Offline lukas.hasik

  • Avast team
  • Advanced Poster
  • *
  • Posts: 905
  • Product manager of Mac AV and Cleanup
Re: Scan File by Terminal Command?
« Reply #5 on: November 20, 2020, 02:38:54 PM »
jmorgan2 - why you need it? I'd recommend to use user interface. Click the "magnifying glass" next to "Smart Scan" button. on main dashboard. You can then use "Targeted Scan" to scan a file.

There is a "Scan with Avast" menu item available in right click menu in Finder. Click the file you want to scan...
Also drag and drop a file to Avast icon in the Dock will start the Targeted scan...
Quality is also a feature.

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #6 on: November 20, 2020, 06:28:23 PM »
Hi Lukas,

I would like to use a command line because the Mac in question is my FTP server and the FTP server software has the ability to run commands on files after they are uploaded in an automated fashion.

I don't have time to sit in front of my FTP server every time a file is uploaded to manually scan it.

Thanks,
Jon

Offline lukas.hasik

  • Avast team
  • Advanced Poster
  • *
  • Posts: 905
  • Product manager of Mac AV and Cleanup
Re: Scan File by Terminal Command?
« Reply #7 on: November 20, 2020, 07:28:20 PM »
ok, I assume that your use case is a bit different than just relying on Avast's file shield which automatically scans files that are written, read or executed.
Quality is also a feature.

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #8 on: November 20, 2020, 08:44:40 PM »
Correct. I don't want AV software potentially interfering with FTP operations. Upon installing Avast, I would perform a full disk scan and after that, disable the shields and rely on a command line function to scan an uploaded file after it has finished uploading.

Can anyone give me the full command necessary to achieve scanning a file on the desktop?

Thanks,
Jon

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #9 on: November 23, 2020, 02:30:23 PM »
Anyone?

Thanks,
Jon

Offline ondrej.kolacek

  • Avast team
  • Sr. Member
  • *
  • Posts: 306
Re: Scan File by Terminal Command?
« Reply #10 on: November 24, 2020, 10:52:16 AM »
Probably run
scan /path/to/directory/or/file
and check the return value. See 'scan -h' for more info.

Offline jmorgan2

  • Newbie
  • *
  • Posts: 12
Re: Scan File by Terminal Command?
« Reply #11 on: November 24, 2020, 03:23:59 PM »
Hi Ondrej,

I get a "-bash: scan: command not found" when I try either command.

Thanks,
Jon