Knowledgebase

need help with an ssh code for finding file

Posted by ransome, 01-16-2013, 12:41 PM
friends .. I have an file uploaded by some one on my image site on Oct 10, 2012... I need to delete that image as it got DMCA notice. Since, my script stores the images in a different name compared to file name, I am not able to figure out where the file is located, there are more than 60k files in the folder. Is there any way I could short list the images uploaded in a particular folder on Oct 10, 2012, so that I could delete the file accordingly ?

Posted by mike86, 01-16-2013, 12:54 PM
try this: ls -l | grep '2012-10-10' That will list all files in the directory along with their modified date, there is no way to find the created date. But if it has been unmodified, then this will be the created date. You should then be able to match up the file by file size. Here's a nice article on the "grep" command, it comes in handy for loads of things: http://www.cyberciti.biz/faq/howto-u...in-linux-unix/

Posted by kevincheri, 01-16-2013, 03:29 PM
You can use something like the below, find /folder -type f -mtime -10 -mtime +9 -iname \*something\* The above will search the entire directory tree under /folder for files under 10 days and over 9 days which have the string something anywhere in the filename. Hope that helps.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Server time off (Views: 596)
MySQL data recovery (Views: 577)


Language:

Client Login

Email

Password

Remember Me

Search