PHP File Finding shell_exec Versus exec Tutorial

PHP File Finding shell_exec Versus exec Tutorial

PHP File Finding shell_exec Versus exec Tutorial

Lots of software based desktop application problems are centred around the finding of files via a time based criteria. With this in mind, today, we combine …

… whether that be related to …

  • file modified time
  • file access time
  • file created time
  • file inode creation time

That sort of “find” file finding functionality find_minus.php‘s live run link can be a part of a “housekeeping” type of scheduled job, such as described via a crontab entry such as …


04 3 * * * ksh -c 'for i in `find ./PHP/animegif -name "0*.php" -mtime +7`; do rm -f $i; done'


Previous relevant PHP shell_exec Versus exec Tutorial is shown below.

PHP shell_exec Versus exec Tutorial

PHP shell_exec Versus exec Tutorial

Being suckers for “out of the box” solutions to programming issues, what comes “out of the box” with your (perhaps underlying) operating system of use is always inflicting “sucker punches” onto areas we didn’t know existed before … well, you had to be there, didn’t you?

That’s why we really like PHP’s “exec” and “passthru” that we have used quite a bit in the past, to get through to that underlying operating system set of commands in its command line environment, as applicable. Even mobile platforms get a go here, because PHP is a serverside language addressing the RJM Programming linux web server, though you can download s_e.php to your local (client) environment, and access a different perspective in an Apache/PHP/MySql local web server environment such as MAMP to work in.

Today, we compare “shell_exec” to “exec” with our proof of concept PHP web application we’ve written for you to try today, for you to see that “shell_exec” is everything “exec” is plus returning the entire command line command’s output, as distinct from the “just last line return” of exec …

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *