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*

3
  • 3
    Very little of this answer actually is relevant to or answers the question. The difference between a cat /dev/null > file and a > file is a cat /dev/null and that makes no difference to the file. Commented May 19, 2014 at 17:05
  • @jw013: True! But I just wanted to take the question's opportunity to re-state the "what you want/not what you want" information, as it's not very well known, and could hit hard someone trying to rotate logs (a common case where you want to truncate a file). Commented May 20, 2014 at 7:29
  • 1
    There is a time and a place for everything. Your information may be useful in some other context but it does not belong here - you should find a more appropriate place for it because nobody trying to rotate logs is going to look in this completely unrelated redirection question. Here your answer is the equivalent of a digital weed, just as an otherwise useful pumpkin plant in the middle of a cornfield would be considered a weed. Commented May 20, 2014 at 14:53