Home » Questions » Computers [ Ask a new question ]

Auto extracting software for Linux? [closed]

Auto extracting software for Linux? [closed]

Do anyone know if there's some decent software which auto extracts anything which gets downloaded (to f.e. ~/Downloads)? If, let's say, I download x.tar, it would automatically extract it to x (folder).

Asked by: Guest | Views: 384
Total answers/comments: 2
Guest [Entry]

"You could maybe try a little mini-daemon along the lines of:

#!/bin/bash

DOWNLOAD_DIR=~/Downloads

while true;
do
for file in $DOWNLOAD_DIR/*.tar*;
do
if [ -f $file ]
then
tar xf $file
if [ $? -eq 0 ] # remove if successfully extracted
then rm $file
fi
fi
done
sleep 5
done

Just start that running and away you go. I'm not sure what the performance implications of a bash forever loop would be, but just looking at it in top it doesn't seem to be too bad (i.e. it isn't in there.) You could boost the sleep time if necessary."
Guest [Entry]

It's not automatic, but "right click > extract here" for gnome extracts it into a folder of the same name.