0

Is there a linux command for getting only the files in a folder and inside its subfolders? I have used the find command, but it is displaying all the files and folders. I am executing this shell command using the php exec() function.

migrated from stackoverflow.com Aug 22 '11 at 12:13

This question came from our site for professional and enthusiast programmers.

5

You should use the -type f option to get only files.

find /path_to_find -type f
  • Thanks xdazz.Is their any way to get the files that are modified after a date like 20-08-2011 – THOmas Aug 22 '11 at 6:04
  • 1
    @THOmas: read the man page & search, this is very frequently asked (and answered) – Mat Aug 22 '11 at 6:06
  • 2
    @THOmas: man find. You can use -mtime, or you can use touch to create a file with the time 20110820 and use -newer. – xdazz Aug 22 '11 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy