I want to gzip recursively all ".txt" files in a certain directory, using the windows command window. Is that possible?
Commands like
>gzip -r tree*.txt
do not seem to work recursively. gzips only the files on first level (.\tree).
Thanks in advance. -karl
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
According to the manual, gzip archives the files given as arguments and, when one of the arguments is a subdirectory, the files in that subdirectory. So, it does not seem possible to gzip the files recursively. You'll have to create a list of files first, e.g. with find from the findutils, and then give these as arguments to gzip. For example:
find.exe tree -name "*.txt" -exec gzip.exe -kvr "{}" ";"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to gzip recursively all ".txt" files in a certain directory, using the windows command window. Is that possible?
Commands like
>gzip -r tree*.txt
do not seem to work recursively. gzips only the files on first level (.\tree).
Thanks in advance. -karl
According to the manual, gzip archives the files given as arguments and, when one of the arguments is a subdirectory, the files in that subdirectory. So, it does not seem possible to gzip the files recursively. You'll have to create a list of files first, e.g. with find from the findutils, and then give these as arguments to gzip. For example:
find.exe tree -name "*.txt" -exec gzip.exe -kvr "{}" ";"