Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

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

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

1 Answer

up vote 5 down vote accepted

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

find /path_to_find -type f
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.