You are only browsing one thread in the discussion! All comments are available on the post page.

Return

verysoft ,

I hate when archives are just a folder inside, now I gotta manually move the files up a level into the directory I wanted them in the first place.

I see this feature is for when there is no folder inside. I come across this a lot less personally.

russjr08 OP ,
@russjr08@outpost.zeuslink.net avatar

That’s perfectly fair! I always seem to have a 50/50 coin toss of whether there will be a folder inside the archive or not.

I think if things were more consistent for what I end up having, I wouldn’t mind it if archives didn’t have a folder or if they always had a folder, rather than the current state.

I suppose in your case, it would be cool if there were a config option to make this do the reverse, unpack the files within the subdirectory of the archive to your current directory.

eager_eagle ,
@eager_eagle@lemmy.world avatar

no, no - the opposite is the actual problem: you extract in a non-empty folder and there’s no top directory in the archive. Now you have a bunch of files mixed up: the extracted ones and the ones that were there before you did it.

Miphera ,

Even better when this happens on a Linux server with no GUI (bonus points if you don’t have much Linux experience yet).

russjr08 OP ,
@russjr08@outpost.zeuslink.net avatar

Honestly now I am curious if there is a CLI equivalent. I always end up using tar’s t flag or opening a zip in vim to see if it has a subfolder as my current workaround…

Qyriad ,
@Qyriad@chaos.social avatar

@Miphera @russjr08 you might want to look into atool's aunpack command

russjr08 OP ,
@russjr08@outpost.zeuslink.net avatar

Oh this looks fantastic! I will be deploying this to all of my systems immediately haha!

elint ,

You get Linux experience real quick when you make mistakes like that in a shell with no GUI.

mkdir newfolder; find . -maxdepth 1 -mmin -5 -exec mv “{}” newfolder ;

Andy ,
@Andy@programming.dev avatar

If you’ll forgive my compulsion to substitute all finds with Zsh globs:


<span style="color:#323232;">$ for f ( ^(newfolder)(mm-5) )  mv -i $f newfolder/
</span>

Assumed:


<span style="color:#323232;">$ mkdir -p newfolder
</span><span style="color:#323232;">$ setopt extendedglob
</span>
verysoft ,

Ahaha yeah, it'd be fine if it was always either way for me, but I personally prefer setting my folder up and then extract the archive into there, so I don't have to rename it or whatever after extracting. So I would rather it have all the files in the top of the archive and not in a folder.

omidmnz ,

The “autodetect subfolder” option handles both scenarios fine. This is actually what makes it useful! If I remember correctly, when there’s a single file or folder inside, it just extracts, otherwise it makes a folder with the same name as the archive without the extension.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • All magazines