tar

CentOS常用基础命令大全

家住魔仙堡 提交于 2019-12-21 10:46:19
这篇文章主要介绍了CentOS常用基础命令大全,学习centos的朋友需要掌握的知识,需要的朋友可以参考下 1.关机 (系统的关机、重启以及登出 ) 的命令 shutdown -h now 关闭系统(1) init 0 关闭系统(2) telinit 0 关闭系统(3) shutdown -h hours:minutes & 按预定时间关闭系统 shutdown -c 取消按预定时间关闭系统 shutdown -r now 重启(1) reboot 重启(2) logout 注销 2.查看系统信息的命令 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpuinfo 显示CPU info的信息 cat /proc/interrupts 显示中断 cat /proc/meminfo 校验内存使用 cat /proc/swaps 显示哪些swap被使用 cat /proc/version 显示内核的版本 cat /proc/net/dev 显示网络适配器及统计 cat /proc

---cenos基本信息和ssh---

元气小坏坏 提交于 2019-12-21 05:09:33
cenos基本信息和ssh CentOS CentOS 是一个基于Red Hat Linux 提供的可自由使用源代码的企业级Linux发行版本。每个版本的 CentOS都会获得十年的支持(通过安全更新方式)。新版本的 CentOS 大约每两年发行一次,而每个版本的 CentOS 会定期(大概每六个月)更新一次,以便支持新的硬件。这样,建立一个安全、低维护、稳定、高预测性、高重复性的 Linux 环境。CentOS是Community Enterprise Operating System的缩写。 CentOS 是RHEL(Red Hat Enterprise Linux)源代码再编译的产物,而且在RHEL的基础上修正了不少已知的 Bug ,相对于其他 Linux 发行版,其稳定性值得信赖。 CentOS在2014初,宣布加入Red Hat。 新版本为 CentOS 7.6(1810) [1] 。上个版本是7.5(1804)。 最新版本特点: 1.可以把CentOS理解为Red Hat AS系列!它完全就是对Red Hat AS进行改进后发布的!各种操作、使用和RED HAT没有区别! 2.CentOS完全免费,不存在RED HAT AS4需要序列号的问题。 3.CentOS独有的yum命令支持在线升级,可以即时更新系统,不像RED HAT那样需要花钱购买支持服务! 4

Interesting usage of tar… but what is happening?

不问归期 提交于 2019-12-21 04:13:15
问题 I saw the following interesting usage of tar in a co-worker's Bash scripts: `tar cf - * | (cd <dest> ; tar xf - )` Apparently it works much like rsync -av does, but faster. The question arises, how? -m EDIT : Can anyone explain why should this solution be preferable over the following? cp -rfp * dest Is the former faster? 回答1: On the difference between cp and tar to copy the directory hierarchies, a simple experiment can be conducted to show the difference: alastair box:~/hack/cptest [1134]%

Write Tar File of Unknown (Large) Size in Java

℡╲_俬逩灬. 提交于 2019-12-21 03:34:19
问题 I'd like to write a large stream of unknown size to a tar file in Java. I know that Apache has the commons compress library which handles tar files, but they require me to know the size in advance. Consider Apache's own example: TarArchiveEntry entry = new TarArchiveEntry(name); entry.setSize(size); tarOutput.putArchiveEntry(entry); tarOutput.write(contentOfEntry); tarOutput.closeArchiveEntry(); I will know the size of the entry after I write it, but not before. Isn't there a way that I can

Autotools - tar This does not look like a tar archive

守給你的承諾、 提交于 2019-12-21 03:27:25
问题 After running make distcheck I get the message that I have successfully built the package and is ready for distribution. If I untar the tar.gz with tar -zxvf hello-0.2.tar.gz it successfully extracts all of its contents. However, when I try to extract them in different machines I get: tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors The weird thing is that it was working before. On the machine I'm trying to build

linux文件压缩和解压缩

 ̄綄美尐妖づ 提交于 2019-12-21 02:34:53
tar 命令用于压缩解压 打包所有内容 tar -cvf 打包文件名 要打包的内容 打包并压缩命令 tar -zcvf 打包文件名 要打包的内容 解包(后缀名为.tar) tar -xvf 文件名.tar 解压缩(后缀名为.tar.gz) tar -zxvf 文件名.tar.gz 参数 -c 打包 -x 解包 -v 显示打包解包过程 -z 压缩 -f 指定压缩文件的名字 打包 :仅仅是包装在一起 压缩 :节省磁盘空间 来源: CSDN 作者: zp1412601533 链接: https://blog.csdn.net/zp1412601533/article/details/103629291

Linux 解压缩命令

戏子无情 提交于 2019-12-20 21:36:21
01-.tar格式解包:[*******]$ tar xvf FileName.tar打包:[*******]$ tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)02-.gz格式解压1:[*******]$ gunzip FileName.gz解压2:[*******]$ gzip -d FileName.gz压 缩:[*******]$ gzip FileName03-.tar.gz格式解压:[*******]$ tar zxvf FileName.tar.gz压缩:[*******]$ tar zcvf FileName.tar.gz DirName04-.bz2格式解压1:[*******]$ bzip2 -d FileName.bz2解压2:[*******]$ bunzip2 FileName.bz2压 缩: [*******]$ bzip2 -z FileName05-.tar.bz2格式解压:[*******]$ tar jxvf FileName.tar.bz2压缩:[*******]$ tar jcvf FileName.tar.bz2 DirName06-.bz格式解压1:[*******]$ bzip2 -d FileName.bz解压2:[*******]$ bunzip2 FileName.bz07-.tar

Ubuntu如何备份和恢复系统

不问归期 提交于 2019-12-20 19:14:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Ubuntu如何备份和恢复系统 在 使用Ubuntu之前,相信很多人都有过使用Windows系统的经历。如果你备份过Windows系统,那么你一定记忆犹新:首先需要找到一个备份工 具(通常都是私有软件),然后重启电脑进入备份工具提供的软件环境,在这里备份或者恢复Windows系统。Norton Ghost是备份Windows系统时经常使用的备份工具。 在备份Windows系统的时候你可能想过,我能不能把整个C盘都放到一个ZIP文件里去呢。这在Windows下是不可能的,因为在Windows中有很多文件在它们运行时是不允许拷贝或覆盖的,因此你需要专门的备份工具对Windows系统进行特殊处理。 和 备份Windows系统不同,如果你要备份Ubuntu系统(或者其它任何Linux系统),你不再需要像Ghost这类备份工具。事实上,Ghost 这类备份工具对于Linux文件系统的支持很糟糕,例如一些Ghost版本只能完善地支持Ext2文件系统,如果你用它来备份Ext3文件系统,你可能会 丢失一些宝贵的数据。 1. 备份系统 我该如何备份我的Ubuntu系统呢?很简单,就像你备份或压缩其它东西一样,使用TAR。和Windows不同,Linux不会限制root访问任何东西,你可以把分区上的所有东西都扔到一个TAR文件里去

linux下批量解压缩

妖精的绣舞 提交于 2019-12-20 19:09:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 方法: 第一: for tar in *.tar.gz; do tar xvf $tar; done for tar in *.tar.bz2; do tar xvf $tar; done 第二:用tar命令批量解压某个文件夹下所有的tar.gz文件 ls *.tar.gz | xargs -n1 tar xzvf 第三:find -maxdepth 1 -name "*.gz"|xargs -i tar xvzf {} 这条命令可解压当前目录下的所有gz文件 批量解压是比较郁闷的事,以前尝试各种方法,甚至用脚本循环语句解压都不行 现在发现这条命令可以搞定,maxdepth表示搜索深度,1代表只搜索当前目录 第四:for i in $(ls *.gz);do tar xvf $i;done 问题: 我想进行批量解压tar文件,使用tar -xvf *.tar会出错,提示“Not found in archive”。解决方法有很多,比如写一个脚本之类的。 请问为什么tar不支持这种通配符语法呢?是否有特殊的原因?我试过gzip就支gzip -d *.tar.gz。 回答: 通配符是shell解决的问题 如 tar -xvf *.tar 实际上执行tar时,tar接收到的是 tar -xvf a.tar b.tar

How to use tar with lz4?

六眼飞鱼酱① 提交于 2019-12-20 15:18:14
问题 How to use tar and filter the archive through LZ4? Or any available tools? It looks cumbersome to use tar cvf folderABC.tar folderABC && lz4c -c0 folderABC.tar . PS: *nix environment 回答1: lz4 has a command line structure similar to gzip. Therefore, something like this will work : tar cvf - folderABC | lz4 > folderABC.tar.lz4 or tar cvf - folderABC | lz4 - folderABC.tar.lz4 First one compresses silently, like gzip. Second one is a bit more lz4-specific, and will also display summarized