LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-28-2016, 09:11 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
GUI file compressor with LZMA2


What GUI file compressors are available for Ubuntu ?

I prefer one that offers LZMA2 to speed up file compression since I have multiple cores.
 
Old 07-29-2016, 01:35 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
xarchiver, file-roller, yad-dialog with a call to tar and probably all the others. Which one of those takes advantage of lzma2 libraries or -utilities, I do not know.

How do you invoke an lzma2 archiver on the command-line, I do not find this apparently new algorithm anywhere (Debian). I am using an lzma5 library but that is probably not what you refer to?!

Last edited by Michael Uplawski; 07-29-2016 at 01:37 AM.
 
Old 07-29-2016, 07:16 AM   #3
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I found it here, though the post is 6 yrs. ago.

http://superuser.com/questions/13189...e-7-zip-faster
 
Old 07-29-2016, 02:27 PM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
Okay, I stand corrected, it is what you referred to. Install lzma and xarchiver and you are done. I have lzma, xz and 7z at my disposition. That is way more lzma than I will ever need.
 
Old 07-29-2016, 08:12 PM   #5
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I installed both, but there is no option for lzma2 where you can pick the number of cpu threads.

I sometimes create large archives and using more cpu cores would help in the speed dept.
 
Old 07-30-2016, 12:53 AM   #6
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by Fixit7 View Post
I installed both, but there is no option for lzma2 where you can pick the number of cpu threads.
For xz this is done with the -T switch on the command line, for 7z it should be -m but I only see -stm (CPU thread affinity mask) which is about the opposite and should serve to limit the number of threads. Maybe 7z as adopted multi-threading as default, in the meantime... I never cared which appears to pay off now.

As your needs are specific, you could always try to write a script and create your own simplistic GUI with yad-dialog.

I happen to have such a simplistic script. It works on single input-files and puts the resulting archive in a destination directory of your choice. You can call it with arguments :
Code:
~$ xtarxz <in-file> <target-directory>
~$ xtarxz <in-file>
or without
Code:
~$ xtarxz
In any case the missing option(s) will be requested, as immediately a file-dialog will open, not one of my own creation. Yad only provides those file- and error-dialogs. Here is the script (note the options to the call to tar). You should probably adapt it to your needs or just take it as an example:
Code:
#!/bin/bash

FILE=''
DIR=''

if [ "$#" -gt 0 ]
then
	if [ -e "$1" ]
	then
		FILE="$1"
	fi
	if [ -d "$2" ]
	then
		DIR="$2"
	fi
fi

cd /tmp
if [ ! -e "$FILE" ]
then
	FILE=$(yad --title "compress" --file --width="550" --height="600")
fi
if [ ! -e "$FILE" ]
then
	yad --title "ERROR" --text="File $FILE does not exist"
	exit 1
fi

if [ ! -e "$DIR" ]
then
	DIR=$(yad --title "destination-directory" --file --directory --width="550" --height="600")
fi

if [ ! -d "$DIR" ]
then
	yad --title "ERROR" --text="Destination $DIR is not a directory or does not exist"
	exit 2
fi


AFILE=$DIR/`basename $FILE`.tar.xz
########### do it ############
/bin/tar -cJvf -T2 $AFILE $FILE 2>/tmp/xtarxz.error
########### did it ########### ... maybe.
if [ -e "$AFILE" ]
then
	yad --title "Result" --text="The archive $AFILE has been created"
else 
	yad --title "ERROR" --text="The archive $AFILE has NOT been created"
fi
As this is rather unspectacular and will probably not arouse your interest in yad, here is the screen shot of two completely different tools, that I “created” (GUIs become ridiculous this way): tiff2pdf pdf2tiff

I found this thread on multi-core compression tools:
https://askubuntu.com/questions/2582...pression-tools

Quote:
I sometimes create large archives and using more cpu cores would help in the speed dept.
Beware that multiple threads will increase memory-usage. But the effect depends on many factors.

Last edited by Michael Uplawski; 07-30-2016 at 01:31 AM. Reason: script and a dozen corrections. For now. ... eternally work in progress. Say stop.
 
Old 07-30-2016, 02:47 AM   #7
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by Michael Uplawski View Post
For xz this is done with the -T switch on the command line, for 7z it should be -m but I only see -stm (CPU thread affinity mask) which is about the opposite and should serve to limit the number of threads. Maybe 7z as adopted multi-threading as default, in the meantime... I never cared which appears to pay off now.

As your needs are specific, you could always try to write a script and create your own simplistic GUI with yad-dialog.

I happen to have such a simplistic script. It works on single input-files and puts the resulting archive in a destination directory of your choice. You can call it with arguments :
Code:
~$ xtarxz <in-file> <target-directory>
~$ xtarxz <in-file>
or without
Code:
~$ xtarxz
In any case the missing option(s) will be requested, as immediately a file-dialog will open, not one of my own creation. Yad only provides those file- and error-dialogs. Here is the script (note the options to the call to tar). You should probably adapt it to your needs or just take it as an example:
Code:
#!/bin/bash

FILE=''
DIR=''

if [ "$#" -gt 0 ]
then
	if [ -e "$1" ]
	then
		FILE="$1"
	fi
	if [ -d "$2" ]
	then
		DIR="$2"
	fi
fi

cd /tmp
if [ ! -e "$FILE" ]
then
	FILE=$(yad --title "compress" --file --width="550" --height="600")
fi
if [ ! -e "$FILE" ]
then
	yad --title "ERROR" --text="File $FILE does not exist"
	exit 1
fi

if [ ! -e "$DIR" ]
then
	DIR=$(yad --title "destination-directory" --file --directory --width="550" --height="600")
fi

if [ ! -d "$DIR" ]
then
	yad --title "ERROR" --text="Destination $DIR is not a directory or does not exist"
	exit 2
fi


AFILE=$DIR/`basename $FILE`.tar.xz
########### do it ############
/bin/tar -cJvf -T2 $AFILE $FILE 2>/tmp/xtarxz.error
########### did it ########### ... maybe.
if [ -e "$AFILE" ]
then
	yad --title "Result" --text="The archive $AFILE has been created"
else 
	yad --title "ERROR" --text="The archive $AFILE has NOT been created"
fi
As this is rather unspectacular and will probably not arouse your interest in yad, here is the screen shot of two completely different tools, that I “created” (GUIs become ridiculous this way): tiff2pdf pdf2tiff

I found this thread on multi-core compression tools:
https://askubuntu.com/questions/2582...pression-tools


Beware that multiple threads will increase memory-usage. But the effect depends on many factors.
Thanks Michael.

I do not mind the command line, but gee wiz.

I wrote many batch files for which I am very appreciative.

I have a request of Linux programmers.

Much of the world was raised with Windoze.

Linux would be a close 2nd if there were not 2000 + versions.

I and many others are willing to take a lot of effort to learn to use a better O.S.

Unfortunately, most folks are not so inclined.
 
Old 07-30-2016, 03:02 AM   #8
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by Fixit7 View Post
Linux would be a close 2nd if there were not 2000 + versions.
You are doing it wrong ;-)

If the fact that many “versions” of “Linux” exist, worries you, then worry no more! This is none of your problems. I venture, that you should rather stick with one desktop environment of your choice and ignore the underlying Linux-distribution as much as possible. There are not so many alternative graphical interfaces and they are easily distinguishable. I do not recommend you anything, as about all the choices are good ones, nowadays.

This said, just pick one distribution, pick one desktop if you find it nice to look at and stick with that for a while. Trust me that all the other choices will not serve you a lot more, than the one that you are about to get accustomed to.

As regards shell scripting. If I write something like
Code:
if [ -e $FILE ]
you will not find that awfully complicated. Now admit that writing the same line 10 times does not introduce further complication to a script, can you? With that hurdle out of the way, read again any shell script of your choice. Reading means: start at the first line, understand it, continue. Reading does not mean: print out the monster and stand in awe...

Do not get overwhelmed by outer appearance, big noise or the number of people who discuss an arbitrary number of Linux-topics, most of which do not touch your interests at all. Get stuff done.

And in hindsight, I want to ask, why the multi-threading compression software interests you more than mastering the tools which are currently at your disposal? I sense that the inconvenience that you get from single-threaded compression does not outweigh the discomfort that comes with a cryptic working environment... Maybe you should set your priorities differently.

Last edited by Michael Uplawski; 07-30-2016 at 03:08 AM. Reason: s
 
Old 07-30-2016, 11:02 AM   #9
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I will take a look at your code this weekend and really study it.

The idea of "parallelizing on any compressed file" is very interesting and seems very doable.

:-)

I do not need one big 2 Gb file when I break it up into smaller pieces.
 
Old 07-30-2016, 04:10 PM   #10
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I must not be understanding the way to compress files using lzma.

Quote:
lzma --compress Documents.xz *.odt
lzma: Documents.xz: No such file or directory
 
Old 07-30-2016, 04:53 PM   #11
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
From the man-page to lzma:
Quote:
Unless --stdout is specified, files other than - are written to a new file whose name is derived from the
source file name:

· When compressing, the suffix of the target file format (.xz or .lzma) is appended to the source filename to
get the target filename.
Try the following syntax:
Code:
~$ lzma -z [input-files]
 
Old 07-30-2016, 05:00 PM   #12
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I want to zip up all .odt files into ONE zip file.

Is lzma not able to use wildcards ?
 
Old 07-30-2016, 05:23 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Use tar with -J option

tar -cJf document.xz *.odt

While tar archives i.e. creates one file, bzip,xz or gzip compresses files.

I will add that you could tar the files without compression then use xz with the -T option as previously suggested.

Last edited by michaelk; 07-30-2016 at 05:45 PM.
 
Old 07-30-2016, 05:48 PM   #14
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I want to use lzma because it uses multiple cores.

Just found this. Is this what I want ?

Quote:
--lzma filter the archive through xz

Last edited by Fixit7; 07-30-2016 at 05:50 PM.
 
Old 07-30-2016, 05:57 PM   #15
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,621
Blog Entries: 40

Rep: Reputation: Disabled
Have you read the man page? If there is an option and the man page says: “This option does the following...”, then it means, “This option does the following...

Quote:
Is this what I want ?
Now this is tough. I want to go to bed now and I won't ask you.

Bye.

Last edited by Michael Uplawski; 07-31-2016 at 03:00 AM. Reason: e
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
video compressor + squid charliepito Linux - Newbie 0 08-29-2013 10:44 AM
[SOLVED] ARJ file compressor for x86_64-bit? stf92 Linux - Software 12 01-29-2013 05:06 PM
Favorite data compressor computer_tom General 5 03-17-2006 09:47 PM
Audio player with dynamic range compressor pdevries Linux - Software 0 02-08-2006 07:26 AM
MPEG2 stream compressor recommendations? cheesekeeper Linux - Software 0 02-25-2005 05:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration