↑ ↓ select, Enter open, Esc close

Find recently modified PHP files

Adjust the values, the command updates live
user@server
find /var/www/vhosts/example.com/httpdocs -type f -name '*.php' -mtime -7 -printf '%TY-%Tm-%Td %TH:%TM  %p\n' | sort -r

Lists all PHP files whose content changed in the last few days, with date and time, newest first. After a break-in, this quickly shows which files were touched. Legitimate changes from updates usually stand out as a block with the same timestamp.

Note: Attackers like to reset the modification time. Using -ctime instead of -mtime checks the status change time, which cannot be faked as easily.

Also searched as

  • find php files modified in last 7 days
  • website hacked which files changed
  • find recently changed files linux

Related one-liners

All in Security

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.