27
Bubbles
5y

Turns out it’s quite annoyingly difficult to create a 5GB txt file titled “test.txt”

Comments
  • 4
    @rutee07 yes I can’t get that out of my memory lol
  • 21
    dd if=/dev/urandom of=test.txt bs=5G bs=1
  • 2
  • 14
    @Bubbles dd if=/dev/urandom of=test.txt bs=64M count=80

    Creates a file called "test.txt" with an input of /dev/urandom and outputs the first 5G of that.
  • 3
    @systemctl oh thats a lot better than how I did it
  • 26
    Just open up vim and have someone who's never used it try to exit 😂
  • 4
    @djlazz3 that’ll never fail
  • 2
    @theKarlisK unless they use google or get bored
  • 8
    Unix has dd.
    Good luck doing it on Windows, you can't even specify an exact limit...
  • 5
    @kescherRant Windows even calculates Gigabytes as Gibibytes, good luck won't be enough :p
  • 2
    @kescherRant I did it on Windows but it was annoying.
  • 6
    @systemctl holy FUCK, the fucking American standardized Gigabytes are SI Gibibytes, and I still hate that because it definitely interferes with the SI Gigabytes...
  • 4
    @kescherRant imagine copying and pasting 1 GB worth of text and waiting to see if the editor crashes or not. VSCode crashed the easiest I’ll tell you that
  • 1
    @theKarlisK it’ll probably be so much easier
  • 1
    @theKarlisK fuck probably. Sublime is what got me through it, even though it struggled harshly
  • 2
    @Bubbles I guess Notepad++ on Windows or any CLI text editor just takes long, but will not crash (at least if 64bit)
  • 1
    @kescherRant it crashed for me but if I have to do it again I’ll try to use it. But it handled it really well
  • 2
    @Bubbles On Windows, Notepad++ is usually the last thing before I whip out the nano included in Git for Windows lol
  • 2
    @kescherRant CLI editors could most likely handle it
  • 1
    @Bubbles Nano is slow if you write a Gigabyte of text into a single line ;)
    (But so is Notepad++)
  • 1
  • 1
    @theKarlisK fuck
  • 3
    On windows, echo some string into a file in a for loop should do.

    Or a quick hack in the scripting language of your choice (python, lua, perl could even do it on the interpreter prompt).
  • 1
    @ddephor that method was brought to my attention when I hit 3GB so I just thought I’m half way there might as well go all the way
  • 2
  • 4
    @bubbles can't you just rename any file from inside a node_modules folder?
  • 1
    @IntrusionCM I didn’t know that existed
  • 2
    @nibor you are correct, but that’s much more than 5 😂
  • 2
    @Bubbles

    I thought so. :) Hope it helps
  • 1
    @halfflat that’s exactly what I used
  • 3
    @Bubbles That's it, now I'm going to test online lipsum generators by telling them to generate gigabytes of data.
  • 2
    @Bubbles if you already had 1GB and you wanted to paste it multiple times, you could've just used cmd and redirected output to append to a file...
  • 1
    @haze I’ve never done that before
  • 2
    @Bubbles command line is very powerful, even on Windows. ;) Redirecting input/output/err is everywhere.

    Also, on Windows /? as arg is pretty universal to get help.
    Since XP was the last Windows that had a somewhat good defrag gui, so I always defrag from there. First defrag /? because I never remember options, then with flags.

    Now I mainly work on Linux because work. And I use redirecting output there if e.g. I have to analyse it and prefer to do it on my machine (I have to execute a lot of things remotely).
  • 3
    Linux:
    dd if=/dev/zero of=test.txt bs=1M count=5000

    Windows:
    fsutil file createnew test.txt 5000000000

    (this doesn't wipe and reallocate all the space immediately like most file creation methods, it just adds the file to the FAT/MFT and calls it good. This makes the creation process almost instant, even when making one file that's several TB large.)
  • 2
    @Bubbles Windows entirely grinds to a halt when more than a couple hundred MB is copied to the universal clipboard.
Add Comment