{"id":6494,"date":"2019-03-12T11:06:07","date_gmt":"2019-03-12T11:06:07","guid":{"rendered":"https:\/\/ittutorial.org\/?p=6494"},"modified":"2019-11-28T08:26:50","modified_gmt":"2019-11-28T08:26:50","slug":"linux-unix-batch-delete-files","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/linux-unix-batch-delete-files\/","title":{"rendered":"Linux Unix Batch Delete Files"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Sometimes you may want to delete all trace, log files, audit files completely.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2550\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2012\/04\/linux-dosya-komutlarc4b1.jpg\" alt=\"\" width=\"435\" height=\"551\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2012\/04\/linux-dosya-komutlarc4b1.jpg 435w, https:\/\/ittutorial.org\/wp-content\/uploads\/2012\/04\/linux-dosya-komutlarc4b1-237x300.jpg 237w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n\n<p>&nbsp;<\/p>\n<p>If any disk or mount pount is nearly full in linux then you will think that What should i delete ?<\/p>\n<p>&nbsp;<\/p>\n<p>You can find out top directories using following my article<\/p>\n<p>&nbsp;<\/p>\n<p>https:\/\/ittutorial.org\/2019\/03\/08\/how-to-find-out-top-directories-and-files-disk-space-in-linux\/<\/p>\n<p>&nbsp;<\/p>\n<p>The answer of above question is mostly log files, trace files, audit files, .xml files and etc&#8230;<\/p>\n<p>If you specify logfiles, trace files directory then you can delete all files together like following.<\/p>\n<p>&nbsp;<\/p>\n<p>&#8211;For IBM AIX, Delete all files which extensions are like .trc Under \/oracle directory<\/p>\n<pre>find \/oracle -name \"*.trc\" -type f -exec rm -f {} \\;<\/pre>\n<p>&nbsp;<\/p>\n<p>&#8212; For Linux, Delete all files which extensions are like .aud Under \/u01 directory<\/p>\n<pre>find \/u01 -name \"*aud\" -print | xargs rm -rf<\/pre>\n<p>&nbsp;<\/p>\n<p>You may want to delete files older than 3 days, you can use following query.<\/p>\n<pre>find \/ -name \"*.log\" -mtime +3 -print | xargs rm -rf<\/pre>\n<p>&nbsp;<\/p>\n<p>You can change extension name and directory name to delete according to your need<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Do you want to learn Linux System Administration for Beginners, then read the following articles.<\/span><\/h4>\n<p><a href=\"https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/\">https:\/\/ittutorial.org\/linux-administration-tutorial-for-beginners\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, Sometimes you may want to delete all trace, log files, audit files completely.<\/p>\n","protected":false},"author":1,"featured_media":2550,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11],"tags":[2327,2328,2329,2325,2334,2333,2429,2428,2430,2431,2330,2335,2331,2336,2332,2427,1031,2112,2114,2099,2326,2113],"class_list":["post-6494","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-linux","tag-biggest-file-in-linux","tag-find-linux-top-directories","tag-find-linux-top-files","tag-how-to-find-out-top-directories-and-files-disk-space-in-linux","tag-linux-biggest-directories","tag-linux-biggest-files","tag-linux-delete-all-files-script","tag-linux-delete-batch-files","tag-linux-delete-files-together","tag-linux-delete-log-files-together","tag-linux-du-k","tag-linux-find-top-files","tag-linux-top-directories","tag-linux-top-directory-delete","tag-linux-top-files","tag-linux-unix-batch-delete-files","tag-mehmet-salih-deveci","tag-oracle-dba-scripts","tag-oracle-monitoring-scripts","tag-oracle-scripts","tag-top-directories-and-files-disk-space-in-linux","tag-useful-oracle-scripts"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2012\/04\/linux-dosya-komutlarc4b1.jpg","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=6494"}],"version-history":[{"count":2,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6494\/revisions"}],"predecessor-version":[{"id":13041,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6494\/revisions\/13041"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/2550"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=6494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=6494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=6494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}