{"id":6422,"date":"2020-08-26T10:08:31","date_gmt":"2020-08-26T10:08:31","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=6422"},"modified":"2026-02-26T14:03:10","modified_gmt":"2026-02-26T14:03:10","slug":"how-to-remove-multiple-files-using-command-line","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/","title":{"rendered":"How to Remove Multiple Files Using Command Line"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">The web-based control panels have been one of the key innovations to take place in the web hosting industry. They are the best method for performing certain tasks that don\u2019t require any specific technical background. However, certain tasks can\u2019t easily achieved using web-based control panels like bulk file management.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Managing multiple files is a bit slower process. That needs to navigated through different directories, more in the case of a Linux-based dedicated server. And hosting several domains on it. In this case, using the file manager through the control panel could be troublesome. Luckily, there are specific quick techniques in the dedicated server to make this process hassle-free with the help of SSH (Secure Shell).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you\u2019re looking to remove multiple files with the help of the command line in a Linux OS. You need to use the command- \u201c<strong>rm<\/strong>\u201d; rm stands for remove. To remove a single file, use the rm command in the following way-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm &lt;<em>yourfilename&gt;<\/em><\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">This command prompts you to choose either to move forward or back out. If you\u2019re looking to skip the back-out process, just add the <strong>\u201c-f\u201d<\/strong> flag to the command for proceeding without confirmation.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you wish to delete the entire directory, use the following command-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm \u2013rf &lt;<em>directory name<\/em>&gt;<\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">in the above command, \u201c<strong>-r<\/strong>\u201d indicates \u201c<strong>recursive,<\/strong>\u201d It will delete the entire directory along with the contents present inside it.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you want to delete only some selected files. Then you\u2019ll have to type each of the file name, separated by a single space-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm &lt;<em>file1<\/em>&gt; &lt;<em>file 2<\/em>&gt;<\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">if you wish to remove all the files from a directory, you need to enter the directory and execute the following command-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm *<\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Files with specific extensions removed with the help of the following command-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm *. &lt;<em>extension name<\/em>&gt;<\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>\u00a0<\/strong>Also, you can remove a file with a specific word using the command-<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\"><strong>rm *<em>enter specific word<\/em>*<\/strong><\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Things that can be performed using the \u201crm\u201d command are not restricted to the above commands. While using the \u201crm\u201d command, you need to ensure that you are using the right commands as deleting files with the \u201crm\u201d command will permanently remove the files from your dedicated servers and these can\u2019t be recovered.<\/p>\r\n<p>Learn <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-run-backup-via-command-line\/\" target=\"_blank\" rel=\"noopener\">How to Run Backup via the Command Line<\/a> Interface, empowering efficient data backup and restoration tasks with precision and flexibility.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>The web-based control panels have been one of the key innovations to take place in the web hosting industry. They are the best method for performing certain tasks that don\u2019t&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[837],"tags":[850],"class_list":["post-6422","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-removing-multiple-files-using-command-line"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Remove Multiple Files Using Command Line - bodHOST<\/title>\n<meta name=\"description\" content=\"In this article you&#039;ll learn how to remove multiple files with the help of command line when operating in Linux OS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove Multiple Files Using Command Line - bodHOST\" \/>\n<meta property=\"og:description\" content=\"In this article you&#039;ll learn how to remove multiple files with the help of command line when operating in Linux OS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-26T10:08:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:03:10+00:00\" \/>\n<meta name=\"author\" content=\"Paul Lopez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Lopez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/\"},\"author\":{\"name\":\"Paul Lopez\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\"},\"headline\":\"How to Remove Multiple Files Using Command Line\",\"datePublished\":\"2020-08-26T10:08:31+00:00\",\"dateModified\":\"2026-02-26T14:03:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/\"},\"wordCount\":408,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"removing multiple files using command line\"],\"articleSection\":[\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/\",\"name\":\"How to Remove Multiple Files Using Command Line - bodHOST\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2020-08-26T10:08:31+00:00\",\"dateModified\":\"2026-02-26T14:03:10+00:00\",\"description\":\"In this article you'll learn how to remove multiple files with the help of command line when operating in Linux OS.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-remove-multiple-files-using-command-line\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorial\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remove Multiple Files Using Command Line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\",\"name\":\"Paul Lopez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"caption\":\"Paul Lopez\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/paullopez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Remove Multiple Files Using Command Line - bodHOST","description":"In this article you'll learn how to remove multiple files with the help of command line when operating in Linux OS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Multiple Files Using Command Line - bodHOST","og_description":"In this article you'll learn how to remove multiple files with the help of command line when operating in Linux OS.","og_url":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2020-08-26T10:08:31+00:00","article_modified_time":"2026-02-26T14:03:10+00:00","author":"Paul Lopez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Paul Lopez","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/"},"author":{"name":"Paul Lopez","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813"},"headline":"How to Remove Multiple Files Using Command Line","datePublished":"2020-08-26T10:08:31+00:00","dateModified":"2026-02-26T14:03:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/"},"wordCount":408,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["removing multiple files using command line"],"articleSection":["Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/","url":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/","name":"How to Remove Multiple Files Using Command Line - bodHOST","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2020-08-26T10:08:31+00:00","dateModified":"2026-02-26T14:03:10+00:00","description":"In this article you'll learn how to remove multiple files with the help of command line when operating in Linux OS.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorial","item":"https:\/\/www.bodhost.com\/kb\/category\/tutorial\/"},{"@type":"ListItem","position":2,"name":"How to Remove Multiple Files Using Command Line"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813","name":"Paul Lopez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","caption":"Paul Lopez"},"url":"https:\/\/www.bodhost.com\/kb\/author\/paullopez\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=6422"}],"version-history":[{"count":5,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6422\/revisions"}],"predecessor-version":[{"id":13036,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6422\/revisions\/13036"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=6422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=6422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=6422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}