I want to maximize my sd card lifespan and Im wondering if redirecting output to /dev/null will reduce my sd card life.
2 Answers
Sending output to /dev/null
means "throw it away". It has no impact on your SD card at all. Of course, the commands that you're running prior and piping to /dev/null
may well be affecting your SD card.
Anything you redirect to /dev/null
gets dumped out an airlock. For example if you were to cat /boot/kernel.img > /dev/null
what's happened is effectively nothing. Of course, cat /boot/kernel.img
would normally just write to the terminal, which is also only a short-term memory cache on the screen. That never gets written to the SD either. There are generally only very specific instances you might want to write to /dev/null
for actual benefit. For example, doing first pass video encoding still prodcues an output file. This you can send to /dev/null
to save writes on the card. When you do the second pass of the encoding then you do the actual writing.
-
2effectively nothing?
cat
will still read! Depending on the source that may effectively touch the network and flush several levels of cache and buffers. Commented Mar 24, 2014 at 12:50 -
Ack! Yes, that's right. I meant that in terms of factors affecting SD card life. There may be some tiny, minor wear due to the read, but my point was that in general
cat
here isn't a command that would be reasonably expected to affect SD card life.– FredCommented Mar 24, 2014 at 14:11