导航:首页 > 文件处理 > 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文件解压相关的资料

热点内容
手机语音加密会议 浏览:587
冰与火pdf 浏览:416
为什么叫我买阿里云服务器 浏览:470
加密货币征税一览表 浏览:959
llc编译器 浏览:922
数控可编程电阻器 浏览:757
培训app源码 浏览:431
phpcurl启用 浏览:533
ubuntu图形编程 浏览:439
jar包启动命令 浏览:678
java数组一维转二维 浏览:498
office批量转pdf 浏览:184
boss直聘程序员多少薪 浏览:631
编程字母代表什么 浏览:954
rainmc服务器地址 浏览:456
电信校园网客户端认证服务器地址 浏览:450
掌阅怎么看文件夹 浏览:343
在伴伴app里面怎么拜师傅 浏览:945
编程珠玑笔记 浏览:282
结束命令行 浏览:271