Use a simple for loop:
for i in *.txt.gz; do zcat "$i" > "$"; done
zcat
is equivalent to gunzip -c
, but shorter.
The variable $i
takes the names of all *.txt.gz
files in the current directory (one after the other). $
strips the extension (.gz
) from the file's name.
Note: This is bash syntax.