• hope
    link
    fedilink
    1258 days ago

    I feel very confident in my understanding of random 8 bit CPUs and their support chips, but asking me to center a div is like this xkcd.

    • Ethan
      link
      fedilink
      English
      298 days ago

      I’ve never understood why people are so intimidated by tar

        • @[email protected]
          link
          fedilink
          English
          348 days ago

          Thanks! This will definitely help me to remember it from now on.

          Me 6 months from now:

          tar -EZVF

          • Oniononon
            link
            fedilink
            English
            3
            edit-2
            7 days ago

            Me in 6 months "how to install winzip using terminal"

        • @[email protected]
          link
          fedilink
          English
          168 days ago

          Nobody wants to deliberately use the wrong compression type when extracting, so modern tar will figure out the compression itself if you just point it at a file. So tar -xf filename works on almost anything. You don’t need to remember which flag to use on a .tar.bz2 file and which one for a .tar.xz file.

        • The Ramen Dutchman
          link
          fedilink
          English
          122 hours ago

          I was about to say tar -CompressZeVuckingFile; great mnemonic and I use it every time!

      • @[email protected]
        link
        fedilink
        7
        edit-2
        8 days ago

        It is “backwards” from some other commands — usually you run copy/rsync/link from source to destination, but with tar the destination (tarball) is specified before the source (directory/files).

        That, and the flags not needing dashes always just throws me for a loop.

        And the icing on the cake is that I don’t use tar for tarring that often, so I lose all muscle memory (untaring a tgz or tar.bz2 is frequent enough that I can usually get that right at least…).

        • Ethan
          link
          fedilink
          English
          2
          edit-2
          8 days ago

          I almost never create a tarball, so I have to look up the syntax for that. Which is as simple as man tar. But as far as extracting it almost couldn’t be easier, tar xf <tarball> and call it a day. Or if you want to list the contents without extracting, tar tf <tarball>. Unless you’re using an ancient version of tar, it will detect and handle whatever compression format you’re using without you having to remember if you need z or J or whatever.

          • The Ramen Dutchman
            link
            fedilink
            English
            1
            edit-2
            22 hours ago

            It can be easier if you’re used to the dash before the arguments; it’s optional but you can put them:

            tar -cf   # Compress File
            tar -xf   # Xtract File
            
      • Eager Eagle
        link
        fedilink
        English
        2
        edit-2
        8 days ago

        I got tired of looking up the options for each possible combination of archiving + compression, so today I have a “magic” bash function that can extract almost any format.

        Then for compressing, I only use zip, which doesn’t need any args other than the archive name and the thing you’re compressing. It needs -r when recursing on dirs, but unlike “eXtract” and “Ze”, that’s a good mnemonic.

      • @[email protected]
        link
        fedilink
        17 days ago

        One reason is that tar supports both traditional style args “tar tf <filename.tar>” and unix-style args “tar -tf <filename.tar>” but there are subtle differences in how they work.

        • Ethan
          link
          fedilink
          English
          16 days ago

          Literally the only time I’ve ever run into that is when I was trying to manipulate the path it extracted to. In 99% of cases I’m doing tf, xf, or cf plus flags for the compression type, etc, and those differences are irrelevant.

          • @[email protected]
            link
            fedilink
            16 days ago

            I used something recently where it wasn’t possible to use the traditional-style args. I think it was a “diff”, which meant I needed a “-f”. It wasn’t a big deal, but, occasionally it does happen.

            • Ethan
              link
              fedilink
              English
              25 days ago

              I’m not saying it doesn’t happen. This thread started because I said I’ve never understood why people talk like tar is some indecipherable black magic. Common tasks are easy and there’s a man page for everything else.