this post was submitted on 17 Mar 2024
1172 points (97.5% liked)

Programmer Humor

22513 readers
1110 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] gaterush@lemmy.world 9 points 1 year ago (6 children)

The other command could just be printf '' >> file to not overwrite it. Or even simpler >>file and then interrupt

[–] owsei@programming.dev 10 points 1 year ago (5 children)

or :>>file then you don't need to interrupt

[–] 4am@lemm.ee 6 points 1 year ago (2 children)

.“:>>” is “append null” right? Do you get a file with a single ASCII NUL or is it truly empty?

[–] al177 4 points 1 year ago* (last edited 1 year ago)

$ :|wc -c 0 $ touch /tmp/f; :>>/tmp/f; wc -c /tmp/f 0 /tmp/f

load more comments (1 replies)
load more comments (3 replies)
load more comments (3 replies)