Is there any command on Linux to convert .tar.gz files to .zip? -


i've received files in .tar.gz type application i'm using accepts .zip files. need easy way of converting .tar.gz files .zip without loosing of data.

does renaming .zip work? i've tried when click on file it's showing invalid file.

any thoughts or inputs this?

you can convert archive foo.tar.gz zipped archive foo.zip command similar one:

tar xzof foo.tar.gz | zip foo.zip $(tar tf foo.tar.gz) 

in details: tar xzof foo.tar.gz extracts (x) gzipped (z) archive standard output (o). here f used provide input file name.

standard input piped zip, first argument name of zipped file produce. following argument list of files compress, can obtain directly tar t command, run on initial .tar.gz file.

for more details, have @ manual pages of zip , tar utilities.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -