r/linuxquestions • u/Royaourt • 6d ago
Resolved What GUI archive methods on Linux also keep the file's file extension?
Hi.
I notice in GNOME & KDE that when I compress a file, it drops the file extension. I'd rather keep the file extension as it makes searching for files a lot easier. I can type it in manually in the archive name just after the archive is created but that's tedious.
Any ideas?
Thanks.
0
Upvotes
6
u/[deleted] 6d ago edited 6d ago
On Gnome you can add an entry to the Nautilus popup menu. See https://wiki.ubuntu.com/Nautilus_scripts
Then, right-click on the files you want to compress, select Scripts ⇨ Compress-Gzip.
You can adapt the script to use another compression command, or to remove the original...
1
u/Royaourt 6d ago
To clarify what I mean. I would like for example, somefile.html to become somefile.html.zip and not somefile.zip.
4
u/ScratchHistorical507 6d ago
What do you mean by "it drops the file extension"? I mean sure, the resulting file will have the file extension of the resulting file and not of the files inside, but that's the whole point of file extensions, to tell the user what type of file it is. And with a quick test with File Roller that's exactly the behavior you're getting.
3
u/DP323602 6d ago
Aren't file extensions a DOS and Windows feature not required in Linux?
3
u/ipsirc 6d ago
What is the purpose of archiving single files?
1
u/Strange_Compote_4592 6d ago
7z?
0
u/calraith 6d ago
You could create a zfs or btrfs partition to store the crap you want to archive.