Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
Display the last modified file in directory in cPanel ☑️ - PC✗3
Display the last modified file in directory in cPanel ☑️

Display the last modified file in directory in cPanel ☑️

From the terminal (SSH):

grep -Ril "find /home/username/public_html/ -type f -mtime -2"

From a .php file:

<?php

$last=shell_exec('grep -Ril "find /home/username/public_html/ -type f -mtime -2"');

echo "<pre>$last</pre>";

?>

The output will be just a file name:

last modified file in cpanel
last modified file in cpanel

If you see a blank page after opening the php file in your browser, contact your hosting provider and ask theem to enable shell_exec

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.