导航:首页 > 文件处理 > gz文件解压

gz文件解压

发布时间:2022-01-31 12:25:55

A. linux如何解压.gz格式的压缩包后,还保留gz压缩包,不自动删它

gunzip -c 123.txt.gz > 123.txt

B. linux怎样解压.gz文件

当在备份重要文件和通过网络发送大文件的时候,对文件进行压缩非常有用。请注意,压缩一个已经压缩过的文件会增加额外开销,因此你将会得到一个更大一些的文件。所以,请不要压缩已经压缩过的文件。在 GNU/Linux 中,有许多程序可以用来压缩和解压缩文件。在这篇教程中,我们仅学习其中两个应用程序。

在类 Unix 系统中,最常见的用来压缩文件的程序是:

C. Linux解压.gz的命令是什么

D. win7系统下怎样解压gz文件

你好,用7zip或者winrar都能直接解压。

E. linux怎样解压gz文件

单纯的.gz文件解压,这种文件不可以使用tar命令解压,需要用gunzip解压,使用命令gzip

解压:gzip -b pythontab.gz

但是注意:gzip貌似不能够设置解压到指定目录,只能解压到当前目录。

解压单纯的.gz文件方法二:

使用zcat命令,然后把标准输出保存到文件即可。

F. *.gz是什么文件如何解压

gzip格式压缩文件
解压命令:gzip -d filename

G. 如何解压gz文件

当在备份重要文件和通过网络发送大文件的时候,对文件进行压缩非常有用。请注意,压缩一个已经压缩过的文件会增加额外开销,因此你将会得到一个更大一些的文件。所以,请不要压缩已经压缩过的文件。在 GNU/Linux 中,有许多程序可以用来压缩和解压缩文件。在这篇教程中,我们仅学习其中两个应用程序。

在类 Unix 系统中,最常见的用来压缩文件的程序是:

H. 如何解压缩.gz文件

public static void makeZip(List<File> fileList,String zipPath,boolean isDelete) {
byte[] buf = new byte[1024];
try {
// Create the ZIP file
File zipFile = new File(zipPath);
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));
// Compress the files
for (int i = 0; i < fileList.size(); i++) {
FileInputStream in = new FileInputStream(fileList.get(i));
// Add ZIP entry to output stream.
out.putNextEntry(new ZipEntry(fileList.get(i).getName()));
// Transfer bytes from the file to the ZIP file
int len;
while ( (len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
// Complete the entry
out.closeEntry();
in.close();
}
// Complete the ZIP file
out.close();
System.out.println("压缩完成.");

//把旧的文件删除
if(isDelete == true){
for (int i = 0; i < fileList.size(); i++) {
File oldFile = fileList.get(i);
oldFile.delete();
}
}
}
catch (IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args){
File in1=new File("D:\\a.txt");
File in2=new File("D:\\b.txt");
File[] file=new File[]{in1,in2};
File zip=new File("D:\\ab.zip");
IDMZip mgr=new IDMZip();
mgr.ZipFiles(file, zip);
}

这个方法不管你是在windows下还是在linux下,都能正常执行。
追问
谢谢,但是我是要解压这样20140718_185819.data.tar.gz 不是zip的

回答
你可以试试。还有这个方法。都是我项目里曾经用到过的。都是可用的。
public static List unZip(String path) throws FileNotFoundException,
IOException {
path = path.replaceAll("\\\\","/");
String zipPath = path.substring(0,path.lastIndexOf("/")+1);
List xmlFileNameList = new ArrayList();
byte[] data = new byte[1024*2];
FileInputStream fis = new FileInputStream(path);
ZipInputStream zis = new ZipInputStream(fis);
ZipEntry entry = null;
while((entry = zis.getNextEntry())!= null){
if(entry.isDirectory()){
File file = new File(zipPath+entry.getName());
file.mkdirs();
continue;
}

阅读全文

与gz文件解压相关的资料

热点内容
阿里云购买服务器如何用现金支付 浏览:683
pythontime等待 浏览:982
单片机串行通信方式 浏览:492
android表格demo 浏览:271
安卓怎么让相册不显示网页 浏览:307
php文件系统源码 浏览:720
易信java 浏览:494
北仑二级压缩螺杆机 浏览:57
加密路线免费入口 浏览:753
计算器程序员是干嘛的 浏览:363
数控编程里fo是啥键 浏览:667
javacdataxml 浏览:956
本机tcp服务器地址 浏览:440
切换pdf 浏览:104
iturns下载的app在哪里 浏览:653
云起书院App在哪里 浏览:627
怎么对hex文件进行加密 浏览:298
pdf少年时 浏览:967
两个同名文件夹同步 浏览:643
拍照文件夹哪个好用 浏览:103