<input type="hidden" id="_wpnonce" name="_wpnonce" value="69198ac6cf" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/4103" /><input type="hidden" id="_wpnonce" name="_wpnonce" value="69198ac6cf" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-json/wp/v2/posts/4103" />{"id":4103,"date":"2016-01-10T22:47:10","date_gmt":"2016-01-10T11:47:10","guid":{"rendered":"https:\/\/www.businesslegions.com\/blog\/?p=4103"},"modified":"2016-01-10T22:47:10","modified_gmt":"2016-01-10T11:47:10","slug":"how-to-delete-certain-files-in-centos-vps","status":"publish","type":"post","link":"https:\/\/www.businesslegions.com\/blog\/2016\/01\/10\/how-to-delete-certain-files-in-centos-vps\/","title":{"rendered":"HOW TO DELETE CERTAIN FILES IN CENTOS VPS"},"content":{"rendered":"<!--CusAds0--><p>The easiest way to delete files based on the filename and extension in CentOS VPS is to use the following syntax: <code><div id=\"wpshdo_1\" class=\"wp-synhighlighter-outer\"><div id=\"wpshdt_1\" class=\"wp-synhighlighter-expanded\"><table border=\"0\" width=\"100%\"><tr><td align=\"left\" width=\"80%\"><a name=\"#codesyntax_1\"><\/a><a id=\"wpshat_1\" class=\"wp-synhighlighter-title\" href=\"#codesyntax_1\"  onClick=\"javascript:wpsh_toggleBlock(1)\" title=\"Click to show\/hide code block\">Source code<\/a><\/td><td align=\"right\"><a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_code(1)\" title=\"Show code only\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/code.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_print(1)\" title=\"Print code\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/printer.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"https:\/\/www.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/About.html\" target=\"_blank\" title=\"Show plugin information\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/info.gif?strip=all&w=960\" \/><\/a>&nbsp;<\/td><\/tr><\/table><\/div><div id=\"wpshdi_1\" class=\"wp-synhighlighter-inner\" style=\"display: block;\"><pre class=\"php\" style=\"font-family:monospace;\">find <span class=\"sy0\">.<\/span> <span class=\"sy0\">-<\/span>name <span class=\"st0\">&quot;[part of the file]*.bak&quot;<\/span> <span class=\"sy0\">-<\/span>type f <span class=\"sy0\">-<\/span>delete<\/pre><\/div><\/div><\/code> For example, if you want to delete images that has the name businesslegions in it use: <code><div id=\"wpshdo_2\" class=\"wp-synhighlighter-outer\"><div id=\"wpshdt_2\" class=\"wp-synhighlighter-expanded\"><table border=\"0\" width=\"100%\"><tr><td align=\"left\" width=\"80%\"><a name=\"#codesyntax_2\"><\/a><a id=\"wpshat_2\" class=\"wp-synhighlighter-title\" href=\"#codesyntax_2\"  onClick=\"javascript:wpsh_toggleBlock(2)\" title=\"Click to show\/hide code block\">Source code<\/a><\/td><td align=\"right\"><a href=\"#codesyntax_2\" onClick=\"javascript:wpsh_code(2)\" title=\"Show code only\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/code.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"#codesyntax_2\" onClick=\"javascript:wpsh_print(2)\" title=\"Print code\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/printer.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"https:\/\/www.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/About.html\" target=\"_blank\" title=\"Show plugin information\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/info.gif?strip=all&w=960\" \/><\/a>&nbsp;<\/td><\/tr><\/table><\/div><div id=\"wpshdi_2\" class=\"wp-synhighlighter-inner\" style=\"display: block;\"><pre class=\"php\" style=\"font-family:monospace;\">find <span class=\"sy0\">.<\/span> <span class=\"sy0\">-<\/span>name <span class=\"st0\">&quot;businesslegions*.jpg&quot;<\/span> <span class=\"sy0\">-<\/span>type f <span class=\"sy0\">-<\/span>delete<\/pre><\/div><\/div><\/code> If you&#8217;re a bit hesitant and want to check which files it will delete\u00a0then use this command (without the -delete): <code><div id=\"wpshdo_3\" class=\"wp-synhighlighter-outer\"><div id=\"wpshdt_3\" class=\"wp-synhighlighter-expanded\"><table border=\"0\" width=\"100%\"><tr><td align=\"left\" width=\"80%\"><a name=\"#codesyntax_3\"><\/a><a id=\"wpshat_3\" class=\"wp-synhighlighter-title\" href=\"#codesyntax_3\"  onClick=\"javascript:wpsh_toggleBlock(3)\" title=\"Click to show\/hide code block\">Source code<\/a><\/td><td align=\"right\"><a href=\"#codesyntax_3\" onClick=\"javascript:wpsh_code(3)\" title=\"Show code only\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/code.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"#codesyntax_3\" onClick=\"javascript:wpsh_print(3)\" title=\"Print code\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/printer.png?strip=all&w=960\" \/><\/a>&nbsp;<a href=\"https:\/\/www.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/About.html\" target=\"_blank\" title=\"Show plugin information\"><img decoding=\"async\" border=\"0\" style=\"border: 0 none\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/info.gif?strip=all&w=960\" \/><\/a>&nbsp;<\/td><\/tr><\/table><\/div><div id=\"wpshdi_3\" class=\"wp-synhighlighter-inner\" style=\"display: block;\"><pre class=\"php\" style=\"font-family:monospace;\">find <span class=\"sy0\">.<\/span> <span class=\"sy0\">-<\/span>name <span class=\"st0\">&quot;[part of the file]*.bak&quot;<\/span> <span class=\"sy0\">-<\/span>type f<\/pre><\/div><\/div><\/code> <img decoding=\"async\" class=\"alignnone size-full wp-image-4106\" src=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all\" alt=\"How to delete certain files in CentOS VPS\" width=\"637\" height=\"192\" srcset=\"https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all 637w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS-300x90.png?strip=all 300w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS-178x54.png?strip=all 178w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all&amp;w=127 127w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all&amp;w=382 382w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all&amp;w=509 509w, https:\/\/cdn.businesslegions.com\/blog\/wp-content\/uploads\/2016\/01\/How-to-delete-certain-files-in-CentOS-VPS.png?strip=all&amp;w=450 450w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/> Hope this helped as I found this very useful.<\/p>\n<div class=\"lt-box\" style=\"border:1px solid #1d6a9e\"><div class=\"lt-box-title\" style=\"background-color:#2485C6;border-top:1px solid #a7cee8;text-shadow:1px 1px 0 #0b283b\">DO YOU LIKE WHAT YOU'VE READ?<\/div><div class=\"lt-box-content\">Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!\r\n\r\n<p><div class=\"tnp tnp-subscription \">\n<form method=\"post\" action=\"https:\/\/www.businesslegions.com\/blog\/wp-admin\/admin-ajax.php?action=tnp&amp;na=s\">\n<input type=\"hidden\" name=\"nlang\" value=\"\">\n<div class=\"tnp-field tnp-field-firstname\"><label for=\"tnp-1\">Name<\/label>\n<input class=\"tnp-name\" type=\"text\" name=\"nn\" id=\"tnp-1\" value=\"\" placeholder=\"\"><\/div>\n<div class=\"tnp-field tnp-field-email\"><label for=\"tnp-2\">Email<\/label>\n<input class=\"tnp-email\" type=\"email\" name=\"ne\" id=\"tnp-2\" value=\"\" placeholder=\"\" required><\/div>\n<div class=\"tnp-field tnp-field-button\" style=\"text-align: left\"><input class=\"tnp-submit\" type=\"submit\" value=\"Subscribe\" style=\"\">\n<\/div>\n<\/form>\n<\/div>\n<\/p>\r\n\r\n<\/div><\/div><!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>The easiest way to delete files based on the filename and extension in CentOS VPS is to use the following syntax: For example, if you want to delete images that has the name businesslegions in it use: If you&#8217;re a bit hesitant and want to check which files it will delete\u00a0then use this command (without [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4105,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[830,1691],"tags":[1836,216,2005,2004,2003,303],"class_list":["post-4103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-technology","category-tip-and-tricks","tag-centos","tag-delete","tag-extension","tag-filename","tag-find","tag-vps"],"_links":{"self":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/4103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/comments?post=4103"}],"version-history":[{"count":3,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/4103\/revisions"}],"predecessor-version":[{"id":4110,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/posts\/4103\/revisions\/4110"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/media\/4105"}],"wp:attachment":[{"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/media?parent=4103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/categories?post=4103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.businesslegions.com\/blog\/wp-json\/wp\/v2\/tags?post=4103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}