Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 2
    \$\begingroup\$ while :;ls>l;done \$\endgroup\$ Commented Apr 1, 2016 at 14:33
  • 1
    \$\begingroup\$ The good old exec trick will do better: ls>l;exec $0. Shorter, but boring. \$\endgroup\$ Commented Apr 1, 2016 at 14:46
  • \$\begingroup\$ :>l;exec $0 - file creation is writing the inode \$\endgroup\$ Commented Apr 1, 2016 at 14:50
  • 7
    \$\begingroup\$ Even though you delete y, yes will still continue to write to the same file handle that it had. Run lsof | grep yes and you should see something like /path/to/y (deleted). This will fill up the disk and fail. \$\endgroup\$ Commented Apr 2, 2016 at 8:43
  • 4
    \$\begingroup\$ Instead of rm y you can use >y which will truncate the existing file. It is also a bit shorter. \$\endgroup\$ Commented Apr 2, 2016 at 21:47