SlackwareThis Forum is for the discussion of Slackware 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.
Been using Slack for a while now, all is going well....until I download source files. I am constantly having to refer to brunolinux.com for the correct syntax to extract the different file associations (tar.gz, tar.bz, tar.bz2 etc)
Is there a program I can install that will give me the ability to issue one command that will work out what type of file it is, then extract the files?
I tried googling, but couldn't express all the above in a query!
Latest tar versions automatically checks which compression algoritthm to use, just run: tar xf file.tar.gz/bz2
And if you want to remain on console, you could use mc (midnight commander) it will allow you to decompress the files with a key and even see inside them before decompressing.
case $SUFFIX in
gz) gunzip $INPUTFILE ;;
bz) your command here ;;
bz2) your command here ;;
*) echo "Sorry I don't recognize the file type for $INPUTFILE "
esac
tar xvf $BASEFILE
The tar is the end of the script above. I'm too lazy to lookup up syntax for extracting the bz or bz2 so will let you do that - essentially just put it in those lines and use "$INPUTFILE" as the file you give the command (like the gz line).
The script would unzip your file (basically create one without the gz, bz or bz2 extension). It would then run the tar command to untar the unzipped file. The tar command actually has a gunzip flag built into it so you could modify it to do that instead - I put it at the bottom because the untar would be common action after each of the unzips.
NOTE: Above is informational only - no warranty expressed or implied - use it at your own risk.
GUI fronends to tar generally take considerably longer to extract stuff as well. If you omit verbosity at the prompt with tar then you can extract stuff way quicker than any other method. I generally use the prompt as well. depends on whether or not I feel like typing at the moment.
try extracting a kernel source with Ark or Fileroller and then execute tar (no -v) from the prompt at the same time. You'll be halfway done compiling the bzImage before the frontend completes...
Some of us want to do it as root without logging in as root. Do you have a way to act as root, right click and Extract? Please tell me, would love to do it that way!
Originally posted by OSourceDiplomat If your system allows root actions for non-root users, it is a) somewhat unusual, and b) extremely insecure.
No, my system doesn't; but that's my point. I would like to sometime, do things graphically as root, (like extracting, browsing, deleting obsolete files). I can't, unless thru terminal. Or I don;t know how?
Ah.
You may want to use Gksu - it runs the program that follows as root. In other words, if you run the following:
gksu [path_to]/nautilus
- a window will pop up and prompt you to enter root password. After that, Nautilus will run as root until closed.
You may not have Gksu installed by default. It is good for making program buttons, too - because of the authentication box popping up. Nice UI feature.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.