<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr" -->

---
title: this file is a TRAP in linux | daily.dev
description: A hands-on demonstration explains named pipes (FIFOs) in Linux, showing how creating a file with mkfifo and writing to it with echo blocks the terminal until...
canonical: https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: this file is a TRAP in linux | daily.dev
og:description: A hands-on demonstration explains named pipes (FIFOs) in Linux, showing how creating a file with mkfifo and writing to it with echo blocks the terminal until...
og:url: https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr
og:image: https://api.daily.dev/og/posts/bLLY7jCmr.png
og:image:alt: this file is a TRAP in linux
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# this file is a TRAP in linux

**[typecraft](https://daily.dev/sources/typecraft)** · 1 min read · 0 upvotes · 0 comments

## Summary

A hands-on demonstration explains named pipes (FIFOs) in Linux, showing how creating a file with mkfifo and writing to it with echo blocks the terminal until another terminal reads from it with cat. The permission string's leading 'p' character identifies it as a named pipe rather than a regular file. Named pipes route data directly through the kernel from writer to reader without touching disk, making them useful for lightweight inter-process communication without consuming ports or disk space.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=Y2Hf9E2vJ6c>

## Questions this post answers

### what is a named pipe in linux and how do I create one

A named pipe (FIFO) is a special file created with the mkfifo command that passes data directly through the kernel from a writer to a reader instead of storing it on disk. Opening one end blocks until the other end is opened; for example, writing to it with echo freezes the terminal until another terminal reads it with cat. Its file listing shows a 'p' as the first permission character, identifying it as a pipe rather than a regular file.

_daily.dev surfaces practical walkthroughs like this for developers digging into linux IPC mechanics._

### why does my terminal freeze when I write to a fifo file with echo

The terminal blocks because a named pipe requires both a reader and a writer to be open simultaneously before data moves through it. Writing with echo into the pipe hangs until another process, such as cat in a separate terminal, opens the pipe for reading; once that happens, both the write and read complete and the terminal unfreezes.

_Developers troubleshooting blocked shell commands can find concrete breakdowns like this on daily.dev._

## Similar posts on daily.dev

- [Reclaim the terminal](https://daily.dev/posts/reclaim-the-terminal-ljfze3w0a) · Lobsters · 0 upvotes · 0 comments
- [abuseofcats.com — stop abusing cat\(1\)](https://daily.dev/posts/abuseofcats-com-stop-abusing-cat-1--fikzkjwkp) · Hacker News · 16 upvotes · 5 comments

---

Tags: [#linux](https://daily.dev/tags/linux)

[View this post on daily.dev](https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"this file is a TRAP in linux","url":"https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr"},"datePublished":"2026-10-02T17:55:07.608Z","dateModified":"2026-10-02T17:55:22.522Z","description":"A hands-on demonstration explains named pipes (FIFOs) in Linux, showing how creating a file with mkfifo and writing to it with echo blocks the terminal until...","image":"https://i.ytimg.com/vi/Y2Hf9E2vJ6c/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/Y2Hf9E2vJ6c/sddefault.jpg","isAccessibleForFree":true,"articleSection":"typecraft","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"typecraft","logo":"https://media.daily.dev/image/upload/s--iVakgkBx--/f_auto/v1728807219/logos/typecraft","url":"https://daily.dev/sources/typecraft"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"this file is a TRAP in linux","description":"A hands-on demonstration explains named pipes (FIFOs) in Linux, showing how creating a file with mkfifo and writing to it with echo blocks the terminal until...","thumbnailUrl":"https://i.ytimg.com/vi/Y2Hf9E2vJ6c/sddefault.jpg","uploadDate":"2026-10-02T17:55:07.608Z","duration":"PT1M","url":"https://api.daily.dev/r/bLLY7jCmr","embedUrl":"https://www.youtube.com/embed/Y2Hf9E2vJ6c"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"typecraft","item":"https://daily.dev/sources/typecraft"},{"@type":"ListItem","position":3,"name":"this file is a TRAP in linux"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/this-file-is-a-trap-in-linux-blly7jcmr#faq","mainEntity":[{"@type":"Question","name":"what is a named pipe in linux and how do I create one","acceptedAnswer":{"@type":"Answer","text":"A named pipe (FIFO) is a special file created with the mkfifo command that passes data directly through the kernel from a writer to a reader instead of storing it on disk. Opening one end blocks until the other end is opened; for example, writing to it with echo freezes the terminal until another terminal reads it with cat. Its file listing shows a 'p' as the first permission character, identifying it as a pipe rather than a regular file. daily.dev surfaces practical walkthroughs like this for developers digging into linux IPC mechanics."}},{"@type":"Question","name":"why does my terminal freeze when I write to a fifo file with echo","acceptedAnswer":{"@type":"Answer","text":"The terminal blocks because a named pipe requires both a reader and a writer to be open simultaneously before data moves through it. Writing with echo into the pipe hangs until another process, such as cat in a separate terminal, opens the pipe for reading; once that happens, both the write and read complete and the terminal unfreezes. Developers troubleshooting blocked shell commands can find concrete breakdowns like this on daily.dev."}}]}
```

