{"id":1260,"date":"2019-03-24T14:03:13","date_gmt":"2019-03-24T14:03:13","guid":{"rendered":"https:\/\/cloudhost.com.ng\/blog\/?p=1260"},"modified":"2019-03-24T14:03:38","modified_gmt":"2019-03-24T14:03:38","slug":"how-to-delete-all-files-in-a-folder-argument-list-too-long-centos-7","status":"publish","type":"post","link":"https:\/\/cloudhost.com.ng\/blog\/how-to-delete-all-files-in-a-folder-argument-list-too-long-centos-7\/","title":{"rendered":"How to Delete All files in a Folder [Linux:Argument list too long] Centos 7"},"content":{"rendered":"\n<p>Many times your tmp folder on your VPS or dedicated server  may be full and prevents you from performing sessions related activities on your website, its important at that point that you clear off the tmp folder, dont worry, you can delete the whole content of that folder. At those times, if you try your regular rm -rf \/tmp\/* , you would get a linux error Argument list too long. , in this case you would need to use the Find command, which has a delete option, <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">find \/tmp\/ -type f -delete<\/pre>\n\n\n\n<p>The above code will safely delete the whole content of your tmp directory. if you need to delete large files in any directory, simply replace the tmp with the path to folder and it will do the magic<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">find \/path\/to\/folder\/ -type f -delete<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"706\" src=\"https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost.png\" alt=\"\" class=\"wp-image-1261\" srcset=\"https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost.png 706w, https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost-150x150.png 150w, https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost-300x300.png 300w, https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost-640x640.png 640w, https:\/\/cloudhost.com.ng\/blog\/wp-content\/uploads\/2019\/03\/Delete-all-files-in-tmp-folder-CloudHost-624x624.png 624w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><figcaption>delete large number of files linux<\/figcaption><\/figure>\n\n\n\n<p>If you have other efficient ways of doing this, please share in the comment section.<\/p>\n\n\n\n<p>This Post was brought to you by <a href=\"https:\/\/cloudhost.com.ng\">CloudHost<\/a>, Domain name, <a href=\"https:\/\/cloudhost.com.ng\/dedicated-servers\/\">Dedicated servers<\/a>, <a href=\"https:\/\/cloudhost.com.ng\/vps-cloud\/\">VPS<\/a>, Linux Windows Email Hosting  that you can trust<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many times your tmp folder on your VPS or dedicated server may be full and prevents you from performing sessions related activities on your website, its important at that point that you clear off the tmp folder, dont worry, you can delete the whole content of that folder. At those times, if you try your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"yst_prominent_words":[],"class_list":["post-1260","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/1260"}],"collection":[{"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/comments?post=1260"}],"version-history":[{"count":2,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/1260\/revisions"}],"predecessor-version":[{"id":1263,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/1260\/revisions\/1263"}],"wp:attachment":[{"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/media?parent=1260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/categories?post=1260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/tags?post=1260"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/cloudhost.com.ng\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=1260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}