hmm... try a script to extract each folder.
Are your archives sequential in names? that would be better. I assume you have the following names
sample directory structure:
Code:
nerdtron@node175:~/main_folder$ ls
archive10.tgz archive2.tgz archive4.tgz archive6.tgz archive8.tgz
archive1.tgz archive3.tgz archive5.tgz archive7.tgz archive9.tgz
extract.sh
We want to extract all those archives to main folder and not create any subfolders right?
Code:
cd /path/to/the/archives
nano extract.sh
Paste the following, and then save and exit the editor.
Code:
#!/bin/bash
for archive in *.tgz ##list all archives for loop
do
tar -zxvf "$archive" ##extract the archive
dirname="${archive%%.*}" ##get the name of the created subfolder
mv "$dirname"/* . ##move all contents of the subfolder up to the current directory
done
Run the script.
After extraction, there will still be subfolders but they won't contain any file cause you already moved them on the script.
Bookmarks