Bash

Process Substitution Cheatsheet

admin by @admin ADMIN
Jun 20, 2026
May 31, 2026
Public
0 0 up · 0 down Sign in to vote
`<(...)` makes a command's output look like a file; `>(...)` makes a command's input look like a file. Killer feature for tools that only accept filenames.
Bash
Raw
# Diff the output of two commands without temp files
diff <(ls /etc/nginx) <(ls /etc/nginx.backup)

# Sort + uniq on two file lists, find files in A but not B
comm -23 <(sort fileA.txt) <(sort fileB.txt)

# Feed a command's output into a tool that wants a file
join -1 1 -2 1 <(sort orders.csv) <(sort customers.csv)

# Capture stderr to a logger AND keep stdout flowing
some_cmd 2> >(logger -t myapp)

# Tee output to multiple consumers via process subs
echo "build complete" | tee >(notify-send "Build") >(logger -t deploy)
Tags

Save your own code snippets

Create a free account and build your private vault. Share publicly whenever you want.