Bonus question: With or without - ?

  • @[email protected]OP
    link
    fedilink
    English
    16
    edit-2
    4 days ago

    When I point an (un)packing program at a packed archive, the default action should be to fucking unpack it.
    And when I point it at anything else, it should pack it into the default format.

    Everything else can be options.

    • Laurel Raven
      link
      fedilink
      English
      73 days ago

      The problem is, tar isn’t a packing program, it’s a tape archive program that’s been repurposed for general files-to-file archival with optional compression plugins

      At this point, if it were written today, it probably would behave as you suggest, but changing it now would break too many things that use it

      • @[email protected]OP
        link
        fedilink
        English
        63 days ago

        Then it would’ve been time to deprecate it for this purpose, and use something sensible instead, say about 13 years ago.
        All the old stuff can then keep using tar, but the nicer option can become the standard for user-friendly file extraction.

    • @rtxn
      link
      English
      -4
      edit-2
      4 days ago

      “The world should conform to my expectations, not long-standing conventions!”

      But if you engage your thinking meat, you might just discover the magic of alias untar='tar xvf'.

      • @[email protected]OP
        link
        fedilink
        English
        11
        edit-2
        4 days ago

        “long-standing conventions” is how you end up with Internet Explorer still pre-installed on Windows Server 2025.
        And when was the last time you used the tar “tape archiver” to archive things on tape?

        • @rtxn
          link
          English
          103 days ago

          Magnetic tapes are still being used as long-term storage, as backups for example. They are inexpensive, compact, have zero moving parts, and are more durable than optical media. All you have to do is keep them in a location that is around room temperature, relatively dry, and away from magnets.

          But that’s not really what tar does. It simply collects the input files and writes them to a single contiguous data stream – a file not unlike an actual tape. It’s worked like that for, I shit you not, 45 years, and it is very much a single project holding up modern technology situation. I fear to imagine what would happen if it were to change.

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

          You may not have heard this, but tar can be used to work with non-tape archives.

          In fact, non-tape archives are the overwhelmingly popular workflow.

          • @electricyarn
            link
            English
            03 days ago

            Does having to explain the history of a tool to understand why it works that way make it more or less useful?

            • Laurel Raven
              link
              fedilink
              English
              33 days ago

              Neither, but understanding that and the ubiquity of that tool might help understand why it can’t simply be changed

        • Laurel Raven
          link
          fedilink
          English
          43 days ago

          No human rights are violated by tar functioning the way it does, but changing it would cause a lot of problems without good reason since you could just as easily write an alias or wrapper to simplify the usage

    • @[email protected]
      link
      fedilink
      English
      13 days ago
      $ tar -h; echo $?
      tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
      Try 'tar --help' or 'tar --usage' for more information.
      2
      $
      

      Lemon squeezy.

    • fraksken
      link
      fedilink
      English
      22 days ago

      xvzf would extract, verbose, unzip file [filename]

  • @SelfProgrammed
    link
    English
    64 days ago

    dtrx = Do The Right eXtraction

    Check your local package manager

  • slazer2au
    link
    English
    54 days ago

    Tar --rfx

    Welpi failed. R isn’t valid in this context.

        • slazer2au
          link
          English
          22 days ago

          r adds files to an existing compressed file.

          So we are saying add a file ®, target this file (t), extract this file (x)

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

    In every tar: xf .

    Although I do admit looking for ‘gtar’ and using it first. #onlyUnixUsersGetIt

  • madthumbsM
    link
    English
    34 days ago

    I remember using a script as a solution, so I’d be a gonner!

  • @Aganim
    link
    English
    24 days ago

    The real question: GNU tar or not?