UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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 :
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
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 :
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
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.