Article 6D465 Software Question

Software Question

by
linux2023
from LinuxQuestions.org on (#6D465)
Dear Team

rm -rf ~/Exam/
mkdir -p ~/Exam/Quarantine
for file in ~/Exam/file{0..9}; do echo ALLOK > $file; done
for i in $(seq 0 $(($RANDOM%10))); do if [ $(($RANDOM%2)) -eq 0 ] ;then echo VIRUS > ~/Exam/file$(($RANDOM%10)) ; else echo virus > ~/Exam/file$(($RANDOM%10)); fi ; done

Questions:
in directory "Exam'" there are 10 files, that only part of them contains the word "VIRUS"

1. can you please help to write command that will find the files that contain the word "VIRUS" and place them to directory Quarantine?
2. can it be possible to perform in one command?

Prompt answer will be appriacted

Sincerely
Linux 2023
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments