If you suspect suspicious changes or want to review recent file modifications in your website’s files, you can check for recently modified files directly on your VPS or Dedicated Server using SSH.
🔹 View Files Sorted by Modification Time
Run the following command (replace username
with your actual cPanel username) to list files in your public_html
directory, sorted by their last modification time:
ls -lrt /home/username/public_html/
- This will display files with the oldest at the top and the newest at the bottom.
🔹 Search for Recently Modified PHP Files
First, navigate to your website’s document root:
cd /home/username/public_html
Then, find all PHP files modified in the last x days. Replace x with the number of days you want to check. For example, to find files modified in the last day, use -1
:
find . -type f -name "*.php" -mtime -1
find .
— searches from the current directory-type f
— limits to files (not directories)-name "*.php"
— matches only.php
files-mtime -1
— shows files modified in the last 1 day
📌 Example for 3 days: use -mtime -3
instead.
✅ Tip
- Always investigate suspicious or unexpected file changes. Recently modified PHP files can indicate malware or unauthorized changes.
- Consider creating regular file integrity checks or backups to help catch issues early.