Tradional Usage
  tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...]

It is invigorating.

  • Muehe@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    9 hours ago

    What nobody posted the tar XKCD yet?

    Title text:

    I don’t know what’s worse–the fact that after 15 years of using tar I still can’t keep the flags straight, or that after 15 years of technological advancement I’m still mucking with tar flags that were 15 years old when I started.

    By the way, tar -h is not a valid command, the flag is related to symlinks. You will want to use -? or --help.

    • sanzky@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      9 hours ago

      I was going to reply with a joke about ffmpeg but it seems the full thread is mostly that.

      • TheSyndZ@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        7
        ·
        2 days ago

        Well i’ll be damned learning just now thanks to you that it equals -rlptgoD (recursive, links, perms, times, group, owner, devices)

        I’m one of the lucky 10000…

        • stembolts@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          9 hours ago

          You have revealed yourself.
          You didn’t read the man page.
          It’s on the -a documentation!!

          Heretic! Jk.

          I only know this because a few years ago I was scripting with rsync and the first thing I did was read thru to see which flags I needed for my usage.

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        7
        ·
        2 days ago

        This comment got my brain stuck in an infinite loop: there’s a rabbit on the Japanese moon, there are tons of moon themed jazz songs, the moon is cheeze, moonshine, moon rhymes with boon, Moon River is a beautiful song, Kame-sennin blew up the moon to make Son Goku revert to his human form, Moonraker was only “meh…”…

        I still don’t get it. WHAT does this expression mean 😭

        • JoeBigelow@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          8 hours ago

          “Do ya want the Moon Mary? Ya know what, that’s what I’ll do. I’ll throw a big lasso up there around the moon and I’ll pull it down here for ya.”

        • cruseo@piefed.world
          link
          fedilink
          English
          arrow-up
          12
          ·
          2 days ago

          To “ask for the moon“ is to make an unreasonable request. The comment is a play on that saying. In this context, it means, “I’ll do the impossible”

    • dual_sport_dork 🐧🗡️@lemmy.world
      link
      fedilink
      arrow-up
      21
      ·
      2 days ago

      Not to mention imagemagick. I can often get ffmpeg to more or less do what I want on the first try, but imagemagick always results in a second try after reading the documentation for the 938th time.

      For the magick stuff I do all the time (you all know what it is) I prepared a script. I wrote it probably a couple of years ago by this point and even if you held a gun to my head and I had it open in the text editor in front of me I couldn’t explain to you what all the flags and arguments actually do.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      16
      ·
      edit-2
      2 days ago

      ffmpeg is always funny to me, because it feels like you could convert anything into anything, if you just knew the right flags, but 99% of my use is extracting a clip out of a video file.

      And the command for that is in my shell history, so I wouldn’t know the flags either. ¯\_(⊙ʖ⊙)/¯

    • ImgurRefugee114@reddthat.com
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      I got it, mostly… The various filter chains, not so much. But I can map input streams and set dispositions and metadata, and know a bunch of svtav1 passthru params by heart; with enough experience to set pretty decent crf/preset/filmgrain-synth settings by eyeballing the input (ofc specifics depends on the video encoder and whether or not I’m using something like the psyex/hdr fork…)

      Some people look at this as wizardry, but it’s really not too hard once to get the hang of ordered arguments… Like whether or not you put -ss before or after -i changes the seeking behavior… Okay, it’s a little wizardry.

    • stoy@lemmy.zip
      link
      fedilink
      English
      arrow-up
      9
      ·
      2 days ago

      I just remember running the coolest ffmpeg command many years ago, I don’t remember the actual command, but it rendered th video as ascii art

    • zackhow@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      I’m just glad that ffmpeg is smart enough when converting audio that all you need to do is pass the input and output.

    • dil@piefed.zip
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      Lemmy got an Ai hate boner but this is the first thing zi ever really used it for that wasn’t research. “Give me the corrct ffmpeg command for _ and explain every flag concisely.”

      • bountygiver [any]@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        1 day ago

        there’s a thing for that that uses far less resources and provides better consistency, it’s called graphical user interfaces

        • dil@piefed.zip
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          17 hours ago

          Shutter encoders fine, but ai only needs to make the command literally once and then its just modify file input , idk why you’re assuming ai runs more than once in this scenario

          Made command once, then I just scrolled up in my history and reused it for the year I was into posting to my 2 fans on tiktok.

          • bountygiver [any]@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            15 hours ago

            if you are good enough to know which command history to use, then the man page is enough.

            Why read through some regurgitated trash when there’s a proper documentation.

            I am assuming ai will be used every time because it is how someone who relies on ai for this task would do

            • dil@piefed.zip
              link
              fedilink
              English
              arrow-up
              1
              ·
              12 hours ago

              “good enough” like any of this shit requires competence or being good at something

            • dil@piefed.zip
              link
              fedilink
              English
              arrow-up
              1
              ·
              12 hours ago

              Whos reading through anything, it outputs one line for my needs, and it did it 2 years ago and I continue to use that one line lmao

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        While I wouldn’t use AI myself for ehtical, environmental and detrimental reasons, I also don’t judge anybody that does. Just make sure to vet the information on your own too! 😊 What did you use ffmpeg for BTW?

        • dil@piefed.zip
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          It’s very clutch in general when you need a smaller file size or different format.

        • dil@piefed.zip
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          Converting my blender videos to smaller sizes for tiktok/ig to avoid their compression. I eventually just started going for smaller 15second vids, don’t usually have to compress and I’m not making money either way. Was pretty useful tho, I saved one command and would just swap the names of the files, used it on my iphone through A-shell quite a bit.

    • silenium_dev@feddit.org
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      I mean, I at least know the simple stuff like transcode (with hw accel), scaling and trimming by heart, but filters? Hell no

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Same here. Except I have only learned how to encode with x264 for now, without hw accel because learning the (in my case) nvenc switches and options is a whole other chapter…

  • Imhotep@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    1 day ago

    If like me you have no memory, use aliases often.

    Put them in a dedicated file, I find it easier to manage. You’ll need to modify bashrc or zshrc to link to the new file. Big plus, they now work with both. I don’t know if it can be done with fish.

    Now my favorite tip for us brainless: start aliases with an easy to reach character you most likely wouldn’t use in a terminal. I use “é”, on a french keyboard.

    é+tab: all my aliases
    é+t+tab: I see “étarextract” (there it is), “étext-edit”, “étodo”

    I don’t even need to remember aliases. I don’t need to remember anything!
    Imathop out.

    • pelya@lemmy.world
      link
      fedilink
      arrow-up
      40
      ·
      2 days ago

      tar is usually smart enough to figure that .tar.gz is a compressed archive, so tar xvf suffices.

      Moreover, .tar.xz archives are much more common nowadays, and the flag to tell tar to use xz decompression is J. Yes, uppercase J I shit you not, because all other letters of alphabet were already taken. The next commandline option added to tar is going to be a Unicode emoji symbol.

        • pelya@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 days ago

          Burrows–Wheeler algorithm or block-compression algorithm, the bzip2 file compression program was developed by Julian Seward.

          Ah yes, totally makes sense.

          XZ Utils started as a Unix port of Igor Pavlov’s LZMA (Lempel–Ziv–Markov) algorithm, by Lasse Collin, and then by the Tukaani Project.

          So apparently the uppercase J stands for “that guy who made a better compression algorithm than Julian”.

      • ruby@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        ·
        2 days ago

        i always forgot about -J so i got used to writing tar --xz -cvf archive.tar.xz file1 file2… instead. it’s a bit more explicit and i’ll never have to hunt for the same flag in the man page again.

  • shrek_is_love@lemmy.ml
    link
    fedilink
    arrow-up
    36
    ·
    2 days ago

    I was going to use this opportunity to shill for tldr by linking directly to their page on tar.

    But I just realized tar’s reputation is so bad, they use it as the example on tldr’s homepage. 😂

  • esc@piefed.social
    link
    fedilink
    English
    arrow-up
    18
    ·
    2 days ago

    It’s pretty simple

    tar
     e[x]tract
     [z]is
     [f]ile
     [v]erbosely
    archive.tar.gz
    --directory=archivedir
    

    For creation it’s pretty much the same but you need to specify [c]reate, e.g. tar czvf archive.tar.gz filestoarchive/ and for lis[t]ing it’s - tar tf archive.tar.gz

  • groucho@retrolemmy.com
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 days ago

    Honestly I just create and extract. I don’t use most of the options. But, I had a lead about ten years ago dare me to create and compress a .tar.gz directly without looking it up and I was most of the way through typing it by the time he finished talking. He looked at me like I was doing black magic.

  • nroth@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    I just recreated my entire fs using tar as an intermediate after using the computer for months with bad RAM. Then it worked. I won’t lie, it felt good.