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.

0

1 Answer 1

5

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

find /path_to_find -type f
3
  • Thanks xdazz.Is their any way to get the files that are modified after a date like 20-08-2011
    – THOmas
    Commented Aug 22, 2011 at 6:04
  • 1
    @THOmas: read the man page & search, this is very frequently asked (and answered)
    – Mat
    Commented Aug 22, 2011 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
    Commented Aug 22, 2011 at 6:14

You must log in to answer this question.