Good day, i want to know what command i can run in cron job for delete the content of a file without delete the file, for example i have a file called: cookies.txt and he create a line of text, but i want delete every minute or 5 minutes, how i can create a cron job for delete the content without the file, i hope somebody can help me. thanks
Hello, You can use following find command with rm option which will find particular find as per your criteria and get it deleted. find . -name "FILE-TO-FIND"-exec rm -rf {} \; Code (markup): OR find . -type f -name "FILE-TO-FIND" -exec rm -f {} \; Code (markup):