Linux - Extract all tar files in a directory
Multiple tar files in a directory and want to extract them all?
This works in the Bash shell:
for a in `ls -1 *.tar.gz`; do tar -zxvf $a; done
Multiple tar files in a directory and want to extract them all?
This works in the Bash shell:
for a in `ls -1 *.tar.gz`; do tar -zxvf $a; done
October 6th, 2008 at 5:07 am
Hello there,
After running the above command, I get the following errors:
ls: No match.
for: Command not found.
a: Undefined variable.
October 6th, 2008 at 8:31 am
Tamon;
Make sure you have the correct apostrophy marks. They must be the “backward” apostrophy. On my MB it’s above the tab key, on my Dell it’s also above the tab key.
Bill