Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hello, I'm new in Linux world. I want to figure out how to delete old files from particular folder. Can anyone help me?
My webcamera produces many photos per day and I need to delete photos which are older than five days. Can anyone help me with the script?
And is there some program in linux which can execute this script every day in particular time? I have UBUNTU.
You left out the xargs command after the pipe character "|".
find ./ -ctime +5 -print0 | xargs -0 -L 500 rm
You might use this is you had a very large number of results that would cause the shell to run out of memory. The "-L 500" argument limits the number of arguments handled at once. The "-print0" argument to find used the NUL character to separate the results. The "-0" argument to xargs means to use NULs to sepatate the arguments. You would want to do this if the filenames contain whitespace characters such as spaces.