{"id":17717,"date":"2023-08-27T07:37:20","date_gmt":"2023-08-27T07:37:20","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=17717"},"modified":"2024-02-11T03:45:27","modified_gmt":"2024-02-11T03:45:27","slug":"bash-piping","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/","title":{"rendered":"Bash Piping"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>Bash piping <\/strong>is a powerful process that allows you to connect multiple commands together in <strong>Linux<\/strong> and other Unix-like shell environments. In a more simple context, a <a href=\"https:\/\/linuxsimply.com\/what-is-piping-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>pipe<\/strong><\/a> redirects the standard output from one command to another for processing. By using the <strong>pipe character \u2018|\u2019<\/strong>, you can connect one command&#8217;s output to another command&#8217;s input. In this writing, I will discuss piping basics, its importance &amp; different operation cases.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><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><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#How_Piping_Works\" >How Piping Works?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#Applications_of_Piping\" >Applications of Piping<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#Basic_Syntax\" >Basic Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#Some_Cases_of_Bash_Piping_Operations\" >Some Cases of Bash Piping Operations<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#A_Read_From_a_Pipe_in_Bash\" >A. Read From a Pipe in Bash<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#B_Pipe_Output_to_a_File_in_Linux\" >B. Pipe Output to a File in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#C_Bash_Pipe_to_Variable\" >C. Bash Pipe to Variable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#D_Bash_Pipe_to_Two_Commands\" >D. Bash Pipe to Two Commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#E_Bash_Double_Pipe\" >E. Bash Double Pipe<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#Benefits_of_Using_Piping\" >Benefits of Using Piping<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#People_Also_Ask\" >People Also Ask<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_Piping_Works\"><\/span>How Piping Works?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>Piping<\/strong> basically passes the output of a command <strong>(stdout) <\/strong>as the input of another command <strong>(stdin)<\/strong>. More like a cooperative medium interacting between commands. It enables commands to operate simultaneously and transfer data continuously, without using temporary files or the display screen. View the graphical representation for a clearer concept:<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-17731\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/Understanding-Bash-piping.png\" alt=\"Understanding bash piping\" width=\"825\" height=\"175\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/Understanding-Bash-piping.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/Understanding-Bash-piping-300x64.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/Understanding-Bash-piping-764x162.png 764w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> Now, the image might inaccurately suggest a sequential flow. Cause, one might assume that the <strong>\u2018Command 2\u2019 <\/strong>receives input only after <strong>\u2018Command 1\u2019<\/strong> has completed execution, which is <strong>not the case<\/strong>. In reality,<strong> Bash<\/strong> launches all the programs in parallel and sets up inputs &amp; outputs accordingly. Each program uses the output from the prior one and feeds the output to the next, respecting the command sequence.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Applications_of_Piping\"><\/span>Applications of Piping<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>Piping <\/strong>is basically used to simplify the process of working with complex data by connecting commands in <strong>Linux.<\/strong> As a result, multiple commands can be written together to perform several processes in a single line. Therefore, it can be used in,<\/p>\n<div class=\"su-list\" style=\"margin-left:8px\">\n<ul>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Counting.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Combining.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Sorting.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Filtering.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Automating Tasks.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Calculation on data.<\/li>\n<li><i class=\"sui sui-arrow-right\" style=\"color:#000000\"><\/i> Manipulating and Transforming data.<\/div><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Basic_Syntax\"><\/span>Basic Syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>Pipes<\/strong> are <strong>unidirectional<\/strong>, flowing data from left to right through the pipeline. The process has a straightforward syntax. The pipe symbol <strong>(|) <\/strong>should be mentioned between the commands to connect them.<\/p>\n<p style=\"text-align: justify;\"><strong>Syntax of Piping:<\/strong><\/p>\n<pre><code class=\"language-bash\" data-line=\"\">Command 1 | command 2 | \u2026 | Command N<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Some_Cases_of_Bash_Piping_Operations\"><\/span>Some Cases of Bash Piping Operations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>Bash piping <\/strong>can connect commands, read data for another command, and pass output to redirect to a file or to a newly assigned variable. With the help of piping, you can operate many more <strong>command-line <\/strong>operations. Some of these cases of operations are discussed below:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"A_Read_From_a_Pipe_in_Bash\"><\/span>A. Read From a Pipe in Bash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can use the <strong>\u2018read command\u2019<\/strong> to read from a <strong>pipe <\/strong>within a <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/introduction\/what-is-bash-scripting\/\" target=\"_blank\" rel=\"noopener\"><strong>Bash script<\/strong><\/a>. The read commands read a line from stdin and assign it to a variable. For example,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo &quot;Hello everyone&quot;\u00a0 | { read name; echo &quot;name=$name&quot;; }<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Here, the <a href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a> outputs the string<strong> \u2018Hello everyone\u2019<\/strong>, and the <strong>pipe operator ( | ) <\/strong>sends the output as input for the next command, where the<strong> read command <\/strong>reads input from the pipe and assigns it to the <strong>variable \u2018name\u2019<\/strong>. Finally, the <strong>echo command<\/strong> echoes the variable value.<\/div><\/div><img decoding=\"async\" class=\"aligncenter size-full wp-image-17725\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/1.-Read-from-a-pipe.png\" alt=\"read from a piped output\" width=\"825\" height=\"158\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/1.-Read-from-a-pipe.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/1.-Read-from-a-pipe-300x57.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/1.-Read-from-a-pipe-768x147.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> From the image, you can see the <strong>read command<\/strong> successfully reads from piped output &amp; later the <strong>value <\/strong>is <strong>displayed<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"B_Pipe_Output_to_a_File_in_Linux\"><\/span>B. Pipe Output to a File in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Piping the output of a command to a file in <strong>Linux <\/strong>is accomplished by piping the output of any command to the <strong>redirection operator \u2018&gt;\u2019 <\/strong>to redirected to a file. For example,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">ls | grep &#039;.txt&#039; &gt; text_files<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Here, the <a href=\"https:\/\/linuxsimply.com\/ls-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>ls command<\/strong><\/a> lists the contents of the current directory. And, the <a href=\"https:\/\/linuxsimply.com\/grep-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>grep command<\/strong><\/a> searches for lines containing the <strong>\u2018.txt\u2019 <\/strong>substring in the output of<strong> ls<\/strong>. The <strong>\u2018&gt;\u2019 operator<\/strong> is used to redirect the filtered output into the file<strong> \u2018text_files\u2019<\/strong>.<\/div><\/div><img decoding=\"async\" class=\"aligncenter size-full wp-image-17726\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/2.-Pipe-output-to-a-file.png\" alt=\"bash pipe output to a file\" width=\"700\" height=\"218\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/2.-Pipe-output-to-a-file.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/2.-Pipe-output-to-a-file-300x93.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/2.-Pipe-output-to-a-file-767x239.png 767w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/> The output is passed successfully to the <strong>\u2018text_files\u2019<\/strong>. As you can see the passed contents inside the file.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"C_Bash_Pipe_to_Variable\"><\/span>C. Bash Pipe to Variable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can perform command substitution to capture the input from a pipe into a variable. For example,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo &#039;Hello!&#039; | { read message; echo &quot;$message&quot; ;\u00a0 }<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Here, the <strong>echo command<\/strong> outputs the string<strong> \u2018Hello!\u2019<\/strong>. After that, the <strong>pipe operator ( | )<\/strong> sends this output to the <strong>read command<\/strong>. Where it reads the input value for the <strong>variable \u2018message\u2019. <\/strong>Finally, the <strong>echo command<\/strong> displays the value.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17727\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/3.-Pipe-to-variable.png\" alt=\"bash pipe to a variable\" width=\"825\" height=\"158\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/3.-Pipe-to-variable.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/3.-Pipe-to-variable-300x57.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/3.-Pipe-to-variable-768x147.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> The output image shows the displayed value of the <strong>variable<\/strong> that was passed through the <strong>pipe operator<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"D_Bash_Pipe_to_Two_Commands\"><\/span>D. Bash Pipe to Two Commands<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can use <strong>Bash piping <\/strong>to send the output of a command to<strong> two different commands <\/strong>simultaneously. For example,<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">ls -l |\u00a0 tee &gt; (grep &#039;.txt&#039; | wc -l)<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Here, the <strong>ls command<\/strong> lists the contents of the current directory.\u00a0 Then, the <a href=\"https:\/\/linuxsimply.com\/tee-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>tee command<\/strong><\/a> reads from <strong>stdin <\/strong>and writes both to its<strong> stdout (displaying on the terminal)<\/strong> and to a specified file or management.<strong> \u2018(grep \u2018.txt\u2019 | wc -l)\u2019<\/strong>, is process substitution. The output of the <strong>\u2018grep command\u2019 <\/strong>(filtered lines containing<strong> \u2018.txt\u2019<\/strong>) is sent to the<strong> \u2018wc -l\u2019 <\/strong>command, where the <a href=\"https:\/\/linuxsimply.com\/wc-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>wc command<\/strong><\/a> counts the number of lines.<\/div><\/div><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17728\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/4.-Pipe-to-two-commands.png\" alt=\"bash piping output to two new commands\" width=\"825\" height=\"259\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/4.-Pipe-to-two-commands.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/4.-Pipe-to-two-commands-300x94.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/4.-Pipe-to-two-commands-768x241.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/> In the image, the first command output <strong>(ls -l)<\/strong> is piped through the next commands (<strong>grep<\/strong> &amp; <strong>wc<\/strong>). And, in between you can see the output displayed for the <strong>tee command<\/strong>.\u00a0 After the execution of commands, you can see the <strong>line number<\/strong> of searched<strong> \u2018.txt\u2019 <\/strong>files is <strong>\u20183\u2019<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"E_Bash_Double_Pipe\"><\/span>E. Bash Double Pipe<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A <strong>double pipe \u2018| |\u2019 <\/strong>is used for conditional execution in <strong>Bash<\/strong>. It executes the command on the right only if the command on the left fails (returns a <strong>non-zero exit status<\/strong>). The basic command syntax:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">command1 | | command2<\/code><\/pre>\n<p style=\"text-align: justify;\">For example, if you want to attempt to remove a file using the <a href=\"https:\/\/linuxsimply.com\/rm-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>rm command<\/strong><\/a>, but it doesn\u2019t exist, you want to create it with the <a href=\"https:\/\/linuxsimply.com\/touch-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>touch command<\/strong><\/a>.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">rm file.txt | | touch file.txt<\/code><\/pre>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17729\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/5.-double-pipe.png\" alt=\"bash double piping\" width=\"825\" height=\"196\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/5.-double-pipe.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/5.-double-pipe-300x71.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/5.-double-pipe-766x182.png 766w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>From the image, you can see the <strong>rm command<\/strong> tries to remove the<strong> \u2018logic.txt\u2019 <\/strong>file but it doesn\u2019t exist. So the next part of the command <strong>(touch)<\/strong> is executed. Even though the output displays the<strong> error message<\/strong> for the first part, the second part does create a file. I viewed that created file using the second command.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Benefits_of_Using_Piping\"><\/span>Benefits of Using Piping<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, there are several advantages and productivity benefits of using <strong>piping<\/strong>. Some of them are listed below:<\/p>\n<ul>\n<li style=\"text-align: justify;\"><strong>Efficient Process: <\/strong>Piping allows you to connect multiple commands together, creating a seamless flow of data between them.<\/li>\n<li style=\"text-align: justify;\"><strong>Segmentation: <\/strong>You can break down complex tasks into smaller, focused commands and chain them together to achieve the desired result.<\/li>\n<li style=\"text-align: justify;\"><strong>Efficient Resource Usage: <\/strong>Avoids creating intermediate files, saving disk space, and reducing I\/O overhead.<\/li>\n<li style=\"text-align: justify;\"><strong>Data Transformation: <\/strong>You can manipulate, filter, sort, and transform data using different commands in a single pipeline.<\/li>\n<li style=\"text-align: justify;\"><strong>Saves Time: <\/strong>Eliminates the need to store intermediate results, saving time on writing and managing temporary files.<\/li>\n<li style=\"text-align: justify;\"><strong>Parallel Processing: <\/strong>Multiple commands in a pipeline can run concurrently, speeding up the overall execution.<\/li>\n<li style=\"text-align: justify;\"><strong>Automation: <\/strong>Allows you to create scripts and workflows that help to automate complex operations.<\/li>\n<li style=\"text-align: justify;\"><strong>Error Isolation: <\/strong>You can easily identify issues by observing the data flow through each command in the pipeline.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To sum up, piping is an important <strong>Bash<\/strong> tool that empowers command-line efficiency &amp; helps users perform their<strong> Bash <\/strong>scripting operations conveniently. Hope this introductory writing on piping helps you understand the entire concept.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><div class=\"su-accordion su-u-trim\">\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What is piping in bash?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> In <strong>Bash<\/strong>, <strong>piping<\/strong> is a means of redirecting standard output from one command to another for processing. By using the <strong>pipe character \u2018|\u2019<\/strong>, you can connect one command&#8217;s output to another command&#8217;s input <\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>How do you use bash pipes?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> Using <strong>Bash pipes<\/strong> is straightforward and can greatly enhance your ability to work with command-line tools. First, select your commands. Each command should perform a specific operation on the data. After that use the piping syntax<strong> \u2018command 1 | command 2\u2026| command N\u2019<\/strong>. Remember to place commands in order according to your need.<\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What is piping in shell?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> <strong>Piping <\/strong>in a shell, such as a <strong>Bash shell<\/strong>, refers to the process of connecting the stdout of one command to the stdin of another command, creating a sequential flow of data between commands. <\/div><\/div>\n<p style=\"text-align: justify;\"><div class=\"su-spoiler su-spoiler-style-fancy su-spoiler-icon-plus su-spoiler-closed\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span><strong>What is piping in Linux?<\/strong><\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\"> In the context of the <strong>command-line interface<\/strong> and <strong>shell<\/strong>, piping in <strong>Linux <\/strong>refers to the mechanism of connecting the output of one command as the input of another command, using the <strong>piping operator \u2018|\u2019.<\/strong>\u00a0 <\/div><\/div>\n<p style=\"text-align: justify;\"><\/div>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/read-from-pipe\/\" target=\"_blank\" rel=\"noopener\">How to Read From Pipe in Bash [5 Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/pipe-output-to-file\/\" target=\"_blank\" rel=\"noopener\">How to Pipe Output to File in Linux [4 Ways]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/pipe-to-two-commands\/\" target=\"_blank\" rel=\"noopener\">Send Pipe Output to Two Commands in Bash [3 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/double-pipe\/\" target=\"_blank\" rel=\"noopener\">How to Use Double Pipe \u201c||\u201d in Bash [3 Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Redirection and Piping&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/\" target=\"_blank\" rel=\"noopener\">Bash Redirection and Piping<\/a><\/span> | <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;17717&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Bash Piping&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bash piping is a powerful process that allows you to connect multiple commands together in Linux and other Unix-like shell &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Bash Piping\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#more-17717\" aria-label=\"Read more about Bash Piping\">Read more<\/a><\/p>\n","protected":false},"author":314897,"featured_media":17730,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[151],"class_list":["post-17717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-bash-redirection-and-piping","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Bash Piping - LinuxSimply<\/title>\n<meta name=\"description\" content=\"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bash Piping - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/moniramunny05\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-27T07:37:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-11T03:45:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Monira Akter Munny\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monira Akter Munny\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/\"},\"author\":{\"name\":\"Monira Akter Munny\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\"},\"headline\":\"Bash Piping\",\"datePublished\":\"2023-08-27T07:37:20+00:00\",\"dateModified\":\"2024-02-11T03:45:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/\"},\"wordCount\":1394,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/bash-piping.png\",\"keywords\":[\"bash redirection and piping\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/\",\"name\":\"Bash Piping - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/bash-piping.png\",\"datePublished\":\"2023-08-27T07:37:20+00:00\",\"dateModified\":\"2024-02-11T03:45:27+00:00\",\"description\":\"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/bash-piping.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/bash-piping.png\",\"width\":400,\"height\":400,\"caption\":\"bash piping\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/piping\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bash Redirection and Piping\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/redirection-and-piping\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Bash Piping\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/2d8ccee92571d892b55ef5999761fc9e\",\"name\":\"Monira Akter Munny\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Monira-Akter-Munny-II-96x96.png\",\"caption\":\"Monira Akter Munny\"},\"description\":\"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/moniramunny05\",\"https:\\\/\\\/www.instagram.com\\\/monira_munny\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/monira-akter-munny-a76742113\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/munny\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bash Piping - LinuxSimply","description":"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.","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:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/","og_locale":"en_US","og_type":"article","og_title":"Bash Piping - LinuxSimply","og_description":"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/moniramunny05","article_published_time":"2023-08-27T07:37:20+00:00","article_modified_time":"2024-02-11T03:45:27+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png","type":"image\/png"}],"author":"Monira Akter Munny","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Monira Akter Munny","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/"},"author":{"name":"Monira Akter Munny","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e"},"headline":"Bash Piping","datePublished":"2023-08-27T07:37:20+00:00","dateModified":"2024-02-11T03:45:27+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/"},"wordCount":1394,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png","keywords":["bash redirection and piping"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/","name":"Bash Piping - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png","datePublished":"2023-08-27T07:37:20+00:00","dateModified":"2024-02-11T03:45:27+00:00","description":"Bash Piping refers to the process of connecting the standard output of one command to the standard input of another command.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/08\/bash-piping.png","width":400,"height":400,"caption":"bash piping"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/piping\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Bash Redirection and Piping","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/redirection-and-piping\/"},{"@type":"ListItem","position":4,"name":"Bash Piping"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/2d8ccee92571d892b55ef5999761fc9e","name":"Monira Akter Munny","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Monira-Akter-Munny-II-96x96.png","caption":"Monira Akter Munny"},"description":"Hello!! This is Monira Akter Munny. I'm a Linux content developer executive here, at SOFTEKO company. I have completed my B.Sc. in Engineering from Rajshahi University of Engineering &amp; Technology in the Electrical &amp; Electronics department. I'm more of an online gaming person who also loves to read blogs &amp; write. As an open-minded person ready to learn &amp; adapt to new territory, I'm always excited to explore the Linux world &amp; share it with you! Read Full Bio","sameAs":["https:\/\/www.facebook.com\/moniramunny05","https:\/\/www.instagram.com\/monira_munny\/","https:\/\/www.linkedin.com\/in\/monira-akter-munny-a76742113\/"],"url":"https:\/\/linuxsimply.com\/author\/munny\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/17717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314897"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=17717"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/17717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/17730"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=17717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=17717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=17717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}