Skip to content

Instantly share code, notes, and snippets.

@eodenyire
Forked from AbdullahGhani1/Linux Find Command.md
Created August 29, 2022 23:20
Show Gist options
  • Save eodenyire/fa5cb372bd9fcddca7cd69bc4f593d3a to your computer and use it in GitHub Desktop.
Save eodenyire/fa5cb372bd9fcddca7cd69bc4f593d3a to your computer and use it in GitHub Desktop.

Click on ✔ and Do The Task Again

During a routine security audit, the team identified an issue on the Nautilus App Server. Some malicious content was identified within the website code. After digging into the issue they found that there might be more infected files. Before doing a cleanup they would like to find all similar files and copy them to a safe location for further investigation. Accomplish the task as per the following requirements:

  1. On App Server 3 at location /var/www/html/blog find out all files (not directories) having .js extension.
  2. Copy all those files along with their parent directory structure to location /blog on same server.
  3. Please make sure not to copy the entire /var/www/html/blog directory content.

SSh on App Server According To Task

ssh tony@stapp01  # App server 1
ssh steve@stapp02 # App server 2
ssh banner@stapp03 # App server 3
sudo find /var/www/html/media -type f -name '*.js' -exec cp --parents {} /media \;    
# Replace media according to Task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment