{"id":48888,"date":"2024-09-30T12:30:00","date_gmt":"2024-09-30T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=48888"},"modified":"2024-08-27T09:01:30","modified_gmt":"2024-08-27T14:01:30","slug":"linux-sed-command","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/","title":{"rendered":"Linux SED Command: Everything you Need to Know"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp\" alt=\"What is Linux SED Command?\" class=\"wp-image-49114\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In this tutorial, we will explain the Linux SED command using some real examples. SED (Stream Editor) is one of the most used Linux commands in scripts and command lines. It searches, replaces, inserts, and deletes strings. The most common use for the SED command is to find and replace a string in a file without opening it, saving time. System administrators regularly use this command while writing scripts and automating tasks on the server.<\/p>\n\n\n\n<p>In the next paragraphs, we will teach you everything you need to know about the SED command. Let&#8217;s get started!<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ecc8b38ac64\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ecc8b38ac64\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Syntax-of-the-SED-command\" >Syntax of the SED command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Create-txt-file\" >Create txt file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Replace-a-string-in-a-file\" >Replace a string in a file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Replace-string-in-a-specific-line\" >Replace string in a specific line<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Replace-a-specific-occurrence-in-the-line-of-the-file\" >Replace a specific occurrence in the line of the file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Print-lines-only-with-the-substituted-text\" >Print lines only with the substituted text<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#Replace-string-with-Ignore-Case\" >Replace string with Ignore Case<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#About-SED-command\" >About SED command<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux VPS<\/a> OS, such as Ubuntu, Debian, or AlmaLinux<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Syntax-of-the-SED-command\"><\/span>Syntax of the SED command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The basic syntax of the SED command is the following one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed OPTIONS... [SCRIPT] [INPUTFILE...]<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create-txt-file\"><\/span>Create txt file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let&#8217;s first one file; we will use that for all examples in the next paragraphs. Create one txt file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano test.txt<\/pre>\n\n\n\n<p>Paste the following lines of code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Three Two One and here we go..\n\nUbuntu is number One is fast and killing like gun, admins are using it for fun.\n\nDebian is number Two and is used by you, if something messy you do not have clue.\n\nAlmaLinux is number three that has to be you can never use it if you dont Linux admin degree.\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Replace-a-string-in-a-file\"><\/span>Replace a string in a file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This example is for replacing a specific string in the whole .txt file. To replace the string &#8220;number&#8221; with the word &#8220;digit&#8221; for example you need to execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed 's\/number\/digit\/g' test.txt<\/pre>\n\n\n\n<p>After executing this command, you will get the output like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sed 's\/number\/digit\/g' test.txt\nThree Two One and here we go..\n\nUbuntu is <strong>digit<\/strong> One is fast and killing like gun, admins are using it for fun.\n\nDebian is <strong>digit<\/strong> Two and is used by you, if something messy you do not have clue.\n\nAlmaLinux is <strong>digit<\/strong> three that has to be you can never use it if you dont Linux admin degree.\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Replace-string-in-a-specific-line\"><\/span>Replace string in a specific line<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To replace the string &#8220;is&#8221; in the third line with &#8220;was&#8221; execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed '3 s\/is\/was\/' test.txt<\/pre>\n\n\n\n<p>You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sed '3 s\/is\/was\/' test.txt\nThree Two One and here we go..\n\nUbuntu <strong>was<\/strong> number One is fast and killing like gun, admins are using it for fun.\n\nDebian is number Two and is used by you, if someting mess you do not have clue.\n\nAlmaLinux is number three that has to be you can never use it if you dont Linux admin degree.\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Replace-a-specific-occurrence-in-the-line-of-the-file\"><\/span>Replace a specific occurrence in the line of the file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To replace a string in some specific occurrence in the line of the file, for example, the word &#8220;is&#8221; in the second occurrence to &#8220;was&#8221; you need to execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed 's\/is\/was\/2' test.txt<\/pre>\n\n\n\n<p>You will notice in the second and the third lines the word &#8220;is&#8221; is changed to was in the second occurrence<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sed 's\/is\/was\/2' test.txt\nThree Two One and here we go..\n\nUbuntu is number One <strong>was<\/strong> fast and killing like gun, admins are using it for fun.\n\nDebian is number Two and <strong>was<\/strong> used by you, if something messy you do not have clue.\n\nAlmaLinux is number three that has to be you can never use it if you dont Linux admin degree.\nroot@host:~# <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Print-lines-only-with-the-substituted-text\"><\/span>Print lines only with the substituted text<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As you can see, the output was the whole text after the change. If we want to see only the changed lines we need to use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed -n 's\/is\/was\/2p' test.txt<\/pre>\n\n\n\n<p>You should see only the lines with changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sed -n 's\/is\/was\/2p' test.txt\nUbuntu is number One was fast and killing like gun, admins are using it for fun.\nDebian is number Two and was used by you, if something messy you do not have clue.\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Replace-string-with-Ignore-Case\"><\/span>Replace string with Ignore Case<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To replace a specific string, whether it is with the lower or upper case, you need to use the i flag in the command. Let&#8217;s replace the word &#8220;two&#8221; with the word &#8220;silver&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sed -n 's\/two\/silver\/ip' test.txt<\/pre>\n\n\n\n<p>You should get only the changed lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sed -n 's\/two\/silver\/ip' test.txt\nThree silver One and here we go..\nDebian is number silver and is used by you, if someting mess you do not have clue.\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"About-SED-command\"><\/span>About SED command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to know in detail about the SED command, you can execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">man sed<\/pre>\n\n\n\n<p>You will get a full explanation of the command, options, synopsis, etc<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SED(1) User Commands SED(1)\n\nNAME\n       sed - stream editor for filtering and transforming text\n\nSYNOPSIS\n       sed [-V] [--version] [--help] [-n] [--quiet] [--silent]\n           [-l N] [--line-length=N] [-u] [--unbuffered]\n           [-E] [-r] [--regexp-extended]\n           [-e script] [--expression=script]\n           [-f script-file] [--file=script-file]<\/pre>\n\n\n\n<p>That was it. You learned some basic and important SED commands on Linux OS. Of course, if you have an issue with a command, you can always contact our technical support, and our admins will help you immediately. We are available 24\/7.<\/p>\n\n\n\n<p>If you liked this post about the SED command, please share it with your friends or leave a comment down below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will explain the Linux SED command using some real examples. SED (Stream Editor) is one of &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Linux SED Command: Everything you Need to Know\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#more-48888\" aria-label=\"Read more about Linux SED Command: Everything you Need to Know\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":49114,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2071],"tags":[104,2181,27,2185,2184],"class_list":["post-48888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-command-line","tag-everything-you-need-to-know","tag-linux","tag-scripts","tag-sed-command","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Linux SED Command: Everything you Need to Know | RoseHosting<\/title>\n<meta name=\"description\" content=\"What is the Linux SED Command and what&#039;s it used for? Find out everything you need to know in our latest guide.\" \/>\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.rosehosting.com\/blog\/linux-sed-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux SED Command: Everything you Need to Know\" \/>\n<meta property=\"og:description\" content=\"Linux SED Command: Everything you Need to Know | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-30T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"Linux SED Command: Everything you Need to Know\",\"datePublished\":\"2024-09-30T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/\"},\"wordCount\":491,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/what-is-a-linux-sed-command.webp\",\"keywords\":[\"Command Line\",\"everything you need to know\",\"Linux\",\"scripts\",\"sed command\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/\",\"name\":\"Linux SED Command: Everything you Need to Know | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/what-is-a-linux-sed-command.webp\",\"datePublished\":\"2024-09-30T17:30:00+00:00\",\"description\":\"What is the Linux SED Command and what's it used for? Find out everything you need to know in our latest guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/what-is-a-linux-sed-command.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/what-is-a-linux-sed-command.webp\",\"width\":1024,\"height\":576,\"caption\":\"What is Linux SED Command?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/linux-sed-command\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux SED Command: Everything you Need to Know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Linux SED Command: Everything you Need to Know | RoseHosting","description":"What is the Linux SED Command and what's it used for? Find out everything you need to know in our latest guide.","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.rosehosting.com\/blog\/linux-sed-command\/","og_locale":"en_US","og_type":"article","og_title":"Linux SED Command: Everything you Need to Know","og_description":"Linux SED Command: Everything you Need to Know | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2024-09-30T17:30:00+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"Linux SED Command: Everything you Need to Know","datePublished":"2024-09-30T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/"},"wordCount":491,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp","keywords":["Command Line","everything you need to know","Linux","scripts","sed command"],"articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/","url":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/","name":"Linux SED Command: Everything you Need to Know | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp","datePublished":"2024-09-30T17:30:00+00:00","description":"What is the Linux SED Command and what's it used for? Find out everything you need to know in our latest guide.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/09\/what-is-a-linux-sed-command.webp","width":1024,"height":576,"caption":"What is Linux SED Command?"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/linux-sed-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Linux SED Command: Everything you Need to Know"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=48888"}],"version-history":[{"count":6,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48888\/revisions"}],"predecessor-version":[{"id":49115,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/48888\/revisions\/49115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/49114"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=48888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=48888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=48888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}