Is there any way to get the last modified date of a directory, including sub directories? either via shell script or php?
Thanks!
feedback
|
|
Here's a shell solution that assumes Linux (or more generally GNU find). For simplicity's sake, file names containing newlines are not supported.
Quick explanation: | |||
|
feedback
|
|
The Unix "stat" command will provide this info, as well as the PHP function by the same name. | |||
feedback
|
|
i 'm not sure what you are asking, but have you tried or even ... find ./ -exec ls -lah {} \; to see the last date of everything. (It can be deployed in *nix systems) | |||
feedback
|
|
A shell script sounds like it might complicate this more then having to, however forgive me if I am not fully understanding the question. tree would be the command I would use for this syntax tree -dfsD | |||
|
feedback
|
|
If you are wanting to see a list of all directories/subdirectories (and not any files) in a location sorted by (and showing) their last modified date, you can use the following command:
Update: You could take it a step further and limit the output to just the last modified date and name of the directory by using
The only problem with either of these listings is that you don't get a full path for each directory, so it can be difficult to tell what directories are subdirectories. | ||||
|
feedback
|