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

热点内容
数据库查询系统源码 浏览:617
php5314 浏览:358
完美国际安装到哪个文件夹 浏览:669
什么app可以扫一扫做题 浏览:540
程序员编码论坛 浏览:924
淘点是什么app 浏览:660
中国高等植物pdf 浏览:454
51单片机时间 浏览:182
后台如何获取服务器ip 浏览:267
单片机流水灯程序c语言 浏览:236
程序员第二职业挣钱 浏览:240
运行里怎么输入服务器路径 浏览:843
pythonstepwise 浏览:512
刘一男词汇速记指南pdf 浏览:66
php认证级别 浏览:371
方舟编译啥时候推送 浏览:1012
php手机验证码生成 浏览:677
哲学思维pdf 浏览:17
凌达压缩机有限公司招聘 浏览:535
weblogic命令部署 浏览:39