Syntax

Bash Pipe Commands Syntax

In Bash, pipe commands: sends one command's output into another — cat log.txt | grep error

Quick Answer

Syntax
cat log.txt | grep error
BashSyntax

Pipe Commands

Code example
cat log.txt | grep error

Sends one command's output into another.

Learn More

How to pipe commands in Bash

  1. Open your Bash file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Bash Pipe Commands Syntax

Use cat log.txt | grep error.

Related Syntax References

Frequently asked questions

What is the Bash syntax for pipe commands?

Use this pattern: cat log.txt | grep error

Can I copy this Bash code example?

Yes. Use Copy code and adapt the example to your program.

Is this Bash syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify