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

It is invigorating.

  • Imhotep@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 minutes ago

    If like me you have no memory, use aliases.

    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.

  • groucho@retrolemmy.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 hours 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.

  • esc@piefed.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    12 hours 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

    • lawks@aussie.zone
      link
      fedilink
      arrow-up
      1
      ·
      10 hours ago

      That mnemonic is misleading if it’s not gzipped, and unless you’re untarring a stream from a pipe or over a network, you don’t need to tell tar what compression was used when extracting, it knows.

    • zackhow@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      7 hours 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.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      14 hours 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. ¯\_(⊙ʖ⊙)/¯

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        14 hours 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 😭

        • cruseo@piefed.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          14 hours 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”

    • dil@piefed.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      13 hours 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.”

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        11 hours 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
          1
          ·
          11 hours 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
          1
          ·
          11 hours 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.

    • dual_sport_dork 🐧🗡️@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      16 hours 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.

    • ImgurRefugee114@reddthat.com
      link
      fedilink
      arrow-up
      0
      ·
      12 hours 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.

    • silenium_dev@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      12 hours 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
        1
        ·
        11 hours 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…

    • stoy@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      16 hours 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

  • shrek_is_love@lemmy.ml
    link
    fedilink
    arrow-up
    7
    ·
    17 hours 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. 😂

          • MaskedNybbles@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            14 hours ago

            e[x]tract; g[z]ip; [v]erbose; [f]ile

            Reordered, and we can have [v]erbosely e[x]tract g[z]ip [f]ile, or tar vxzf [file]

            I find it more difficult to remember other options. Might stick better if pronouncing the g in gzip similarly as GNU insists GNU be pronounced, with a hard g—never really tried it, but sounds a little funny. Actually, I think I first remembered it as g sounding like the, making for extract the zip file, but with a soft g; I felt the former put too much emphasis on a letter not used as an option.

  • entwine@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    14 hours ago

    Tar (some versions at least?) is actually smart enough to detect which format to use based on file extension of the output, so you don’t need to remember which flag corresponds to which compressor. Examples:

    tar -caf archive.tar.xz [files]
    tar -caf archive.tar.bz2 [files]
    
    # extract
    tar -xf archive.tar.xz
    tar -xf archive.tar.bz2
    

    So you really only need to remember that c means create, x means extract

  • Phoenixz@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    16 hours ago

    Why is everyone always going in about tar? I never saw the issue with it, its not more or less complicated than other commands that take command line flags…

    For example: sudo netstat -peanut, where -peanut actually expands to -p -e -a -n -u -t. I don’t have any idea anymore what each letter stands for while I do recall that tar -cjf file.tar * is -c create, -j bzip2 compression and -f filename