linux tar.gz安装方法

转自 http://baile8410.iteye.com/blog/546517

2009-08-23 11:39
linux下解压tar.gz文件
下面所所有操作,后面有所有步骤说明
[yonghu@localhost ~]#       su root
口令:                                      
[root@localhost ~]#         cd /home/new/Desktop
[root@localhost Desktop]#   tar -xzvf fcitx-3.4.2.tar.gz
[root@localhost Desktop]#   cd /home/new/Desktop/fcitx-3.4.2
[root@localhost fcitx-3.4.2]#./configure --prefix=/opt/fictx
[root@localhost fcitx-3.4.2]#make
[root@localhost fcitx-3.4.2]#make install

各步骤详解

[yonghu@localhost ~]#su root       //(使用root帐户登录,使用其他用户,之后操作有可能权限不够)
口令:                                             // 输入root密码
[root@localhost ~]# cd /home/new/Desktop

// (切换到tar.gz文件所在目录,这里我的tar.gz文件在桌面)

[root@localhost Desktop]#tar -xzvf fcitx-3.4.2.tar.gz

// (解压tar.gz文件,这里以fcitx-3.4.2来举例,解压得到fcitx-3.4.2文件夹)

[root@localhost Desktop]#cd /home/new/Desktop/fcitx-3.4.2

//(切换目录到fcitx-3.4.2,软件解压的目录)

[root@localhost fcitx-3.4.2]#./configure --prefix=/opt/fictx

//(配置,把文件存放在/opt/fictx下,删除时,卸载软件时,只要删除这个文件就行了)

[root@localhost fcitx-3.4.2]#make (编译)

[root@localhost fcitx-3.4.2]#make install (安装)




在tar.gz的东西不多了~~~~
========================================
大多以tar.gz 和tar.bz2打包软件,大多是通过 ./configure ;make ;make install 来安装的;有的软件是直接make;make install ;

我们可以通过./configure --help 来查看配置软件的功能;大多软件是提供./configure 配置软件的功能的;少数的也没有,如果没有的就不用./configure ;直接make;make install 就行了;

./configure 比较重要的一个参数是 --prefix ,用--prefix 参数,我们可以指定软件安装目录;当我们不需要这个软件时,直接删除软件的目录就行了;

比如我们可以指定fcitx 安装到 /opt/fcitx 目录中;


[root@localhost fcitx]#./configure --prefix=/opt/fcitx

如果我们不需要fcitx 时,可以直接删除 /opt/fcitx 目录;

所以我们举这个例子中,fcitx如果定制安装到 /opt/fcitx目录中,完整的安装方法应该是:


[root@localhost fcitx]# tar jxvf fcitx-3.2-050827.tar.bz2
[root@localhost fcitx]#cd fcitx
[root@localhost fcitx]# ./configure --prefix=/opt/fcitx
[root@localhost fcitx]# make
[root@localhost fcitx]# make install

====================================================================

一、什么是源码包软件;

顾名思义,源码包就是源代码的可见的软件包,基于Linux和BSD系统的软件最常见;在国内源可见的软件几乎绝迹;大多开源软件都是国外出品;在国内较为出名的开源软件有fcitx;lumaqq;Lumaqq及scim等;

但软件的源代码可见并不等于软件是开源的,我们还要以软件的许可为准;比如有些软件是源码可见的,但他约定用户只能按他约定的内容来修改;比如vbb论坛程序;所以一个软件是否是开源软件,得具备两个条件;一是源代码可见;二是要有宽松的许可证书,比如GPL证书等;

在GNU Linux或BSD社区中,开发人员在放出软件的二进制软件包的同时,也会为我们提供源代码软件包;

二、源代码有何用?

一个软件的如果有源码,是任何人都能看到他是怎么开发而来的,就像一个瓶子,比如瓶子制作的模具是什么;需要什么材料;具体的用途以及瓶子的详细说明书等等。软件的开放源码就是类似,开发者在给我们软件的同时,也会告诉我们软件是怎么开发出来的;只要我们的水平足够的高,所有的代码都在那里,我们就可以修改和定制软件,以适合我们的需要;如果Windows开放源代码,并以GPL发布,一样是有人能造出来N多的Windows发行版;遗憾的是 Windows并不是开源系统;

所以软件的源代码的用处无非是以下两点;

1、软件根据用户的需要加以定制;
2、二次开发;注:要根据软件的许可证书约定为准,开发者许可二次开发才行;

三、怎样安装以源码包打包的软件;

1、源码包的打包格式;

源代码一般以file.tar.gz file.tar.bz2或file.src.rpm 打包;file.tar.gz和file.tar.bz2格式的解包命令如下;
[root@localhost beinan]# tar jxvf file.tar.bz2
[root@localhost beinan]# tar zxvf file.tar.gz

至于file.src.rpm 的用法,请参见:《file.src.rpm 使用方法的简介》

2、如何编译安装源码包;(大多数)

1)解开软件包查看帮助文档;

我们解开一个包后,进入解压包,一般都能发现README(或reame)和INSTALL( 或install);或doc(或DOC)目录;看名字就知道个差不多;

比如我们下载一个比较新的fcitx 的软件包,比如是 fcitx-3.2-050827.tar.bz2

我们在解开这个软件包会会发现如下的文件;

[root@localhost fcitx]# tar jxvf fcitx-3.2-050827.tar.bz2
[root@localhost fcitx]#cd fcitx
[root@localhost fcitx]# ls
aclocal.m4 config.guess configure debian INSTALL Makefile.in src xpm
AUTHORS config.h.in configure.in depcomp install-sh missing THANKS
autogen.sh config.rpath COPYING doc lib mkinstalldirs TODO
ChangeLog config.sub data fcitx.spec.in Makefile.am README tools

所以我们就可以看fcitx的INSTALL 和doc目录的安装文档了;里面都告诉我们如何安装;

有时安装文档也会在开发者的主页上有详细的说明,及常见问题的处理等;比如 LumaQQ

2)编译安装软件的条件;

首先我们在Linux系统中至少得把开发工具安装上,比如 gcc ;perl;python;glibc;gtk;make ;automake 等开发工具或基础包;还要安装一些相应的开发包,一般是文件名包括dev的,比如kernel-devel;还有一些开发库,比如以lib开头的;如果您在编译软件时,有时提示缺少什么东西之类的,大多少的是这些开发工具和开发库等;从光盘中找出安装就是了;有时光盘没有提供,请用google搜索相应的软件包,有时可能也会用到源码包编译安装所依赖的包;

有时本来系统中已经安装了所依赖的包,但系统提示找不到应该怎么办?这时需要我们设置一下PKG_CONFIG_PATH的环境变量就行了;

#export PKG_CONFIG_PATH=/usr/lib/pkgconfig

#export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
然后我们再来运行编译的./configure ;make ;make install ,尝试着来吧;

以java开发的工具开发的程序,要用到 jre或者jdk ;jdk已经包括jre了,所以如果我们只是要求有一个java程序运行的环境,只需要安装jre就行了;安装好jre,配置一下java的环境变量就可以用了。如果是图形界面的程序,点点鼠标就OK了;

用perl 开发的程序,是需要perl环境的,所以必须得把perl的包安装上,python 也同理;

3)编译安装软件的方法;

大多以tar.gz 和tar.bz2打包软件,大多是通过 ./configure ;make ;make install 来安装的;有的软件是直接make;make install ;

我们可以通过./configure --help 来查看配置软件的功能;大多软件是提供./configure 配置软件的功能的;少数的也没有,如果没有的就不用./configure ;直接make;make install 就行了;

./configure 比较重要的一个参数是 --prefix ,用--prefix 参数,我们可以指定软件安装目录;当我们不需要这个软件时,直接删除软件的目录就行了;

比如我们可以指定fcitx 安装到 /opt/fcitx 目录中;
[root@localhost fcitx]#./configure --prefix=/opt/fcitx

如果我们不需要fcitx 时,可以直接删除 /opt/fcitx 目录;

所以我们举这个例子中,fcitx如果定制安装到 /opt/fcitx目录中,完整的安装方法应该是:
[root@localhost fcitx]# tar jxvf fcitx-3.2-050827.tar.bz2
[root@localhost fcitx]#cd fcitx
[root@localhost fcitx]# ./configure --prefix=/opt/fcitx
[root@localhost fcitx]# make
[root@localhost fcitx]# make install

调用fcitx ,应该是
[beinan@localhost ~]#/opt/fcitx/bin/fcitx

如果您想要让fcitx 只要执行fcitx ,就能调用,请配置环境变量,或者在/usr/bin 中做一个fcitx 的链接;
[root@localhost beinan]# ln -s /opt/fcitx/bin/fcitx /usr/bin/fcitx

一般的情况下都有说,但大多软件没有提供源码包的卸载方法;我们可以找到软件的安装点删除。主要看你把它安装在哪了。

设置环境变量PATH,请参见:《在Fedora Core 中,有些常用命令怎么没有?解决办法设置PATH》

所以您的PATH可以设置成这样的;
export PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin:/sbin:/opt/fcitx/bin"

当然这只是举个例子,fcitx 可以进入桌面自动运行的,请参看 http://www.fcitx.org 官方站上的安装说明;举个例子只是让大家好理解一点;

再举一个例子,比如我想安装mlterm ;并指定安装目录为/opt/mlterm中; http://mlterm.sourceforge.net

#./configure --prefix=/opt/mlterm
#make
#make install

把源码包安装的软件,都指定安装在 /opt目录中,这样不就知道了软件安装在哪里了;也方便卸载;

3.其它类型软件;

1)基于perl 和python 的程序的安装;

一般情况下,用 #perl file.pl安装;比如:VMware 的Linux版本的安装;
[root@localhost vmware-distrib]# perl vmware-install.pl

基于python 开发,也得用 python file.py 来安装

一般软件包都有README和INSTALL 或者 DOC 文档,看文档安装;

2)有些安装程序是脚本型的调用;要用 #sh 文件名

比如NVdia驱动的安装就是这样的;
[beinan@localhost ~]# sh NFORCE-Linux-x86-1.0-0306-pkg1.run

当然也能通过 chmod 755 NFORCE-Linux-x86-1.0-0306-pkg1.run ,然后 ./NFORCE-Linux-x86-1.0-0306-pkg1.run 来安装;

也有一些是以file.bin 文件
[beinan@localhost ~]# chmod 755 file.bin
[beinan@localhost ~]# ./file.bin

大抵如此。。。。。。。。

后记: 源码包及特殊格式的软件安装就写这么多,写的再多也是写不完。我们主要还是以软件的安装文档为准;安装软件时,如果只是简单的应用,如果有rpm包,尽可能的用rpm包;主要是方便和易于管理;

附录:

安装软件时,最好用各自发行版所提供的系统软件包管理工具,对于Fedora/Redhat 您可以参考如下文章;

0)RPM 基础 《RPM 的介绍和应用》

1)Fedora 系统管理软件包工具 system-config-packages,方便的添加和移除系统安装盘提供的软件包,详情请看 《Fedora 软件包管理器system-config-packages》

2)Redhat 系统管理软件包工具,新一点的系统应该是 redhat-config-packages ,用法和 《Fedora 软件包管理器system-config-packages》 一样;

3)apt + synaptic 软件包在线安装、移除、升级工具; 用法:《用apt+synaptic 在线安装或升级Fedora core 4.0 软件包》
4)yum 软件包在线安装、升级、移除工具;用法:《Fedora/Redhat 在线安装更新软件包,yum 篇》

5)《file.src.rpm 使用方法的简介》

6)《如何编译安装源码包软件》

目前 apt和yum 已经极为成熟了,建议我们安装软件时采用 apt或者yum ;如果安装系统盘提供的软件包,可以用 system-config-packages 或redhat-config-packageshttp://baile8410.iteye.com/blog/546517


======================================================================================

tar linux 命令说明 (2007-11-19 10:09)
分类: Linux 命令

tar  linux 命令说明

参考资料

l        《鸟哥的 Linux 私房菜》之 “档案的压缩与打包

l        《Linux 基础教程(1) 操作系统基础》第14章

 

简介

参数:

-c  :建立一个压缩档案的参数指令(create 的意思);

-x  :解开一个压缩档案的参数指令!

-t  :查看 tarfile 里面的档案!

      特别注意,在参数的下达中, c/x/t 仅能存在一个!不可同时存在!

      因为不可能同时压缩与解压缩。

-z  :是否同时具有 gzip 的属性?亦即是否需要用 gzip 压缩?

-j  :是否同时具有 bzip2 的属性?亦即是否需要用 bzip2 压缩?

-v  :压缩的过程中显示档案!这个常用,但不建议用在背景执行过程!

-f  :使用档名,请留意,在 f 之后要立即接档名喔!不要再加参数!

   例如使用『 tar -zcvfP tfile sfile』就是错误的写法,要写成

   『 tar -zcvPf tfile sfile』才对喔!

-p  :使用原档案的原来属性(属性不会依据使用者而变)

-P  :可以使用绝对路径来压缩!

-N  :比后面接的日期(yyyy/mm/dd)还要新的才会被打包进新建的档案中!

--exclude FILE:在压缩的过程中,不要将 FILE 打包!

范例:

范例一:将整个 /etc 目录下的档案全部打包成为/tmp/etc.tar

[root@linux ~]# tar -cvf /tmp/etc.tar /etc  <==仅打包,不压缩!

[root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc  <==打包后,以 gzip 压缩

[root@linux ~]# tar -jcvf /tmp/etc.tar.bz2 /etc  <==打包后,以 bzip2 压缩

# 特别注意,在参数 f 之后的档案档名是自己取的,我们习惯上都用 .tar 来作为辨识。

# 如果加 z 参数,则以 .tar.gz 或 .tgz 来代表gzip 压缩过的 tar file ~

# 如果加 j 参数,则以 .tar.bz2 来作为附档名啊~

# 上述指令在执行的时候,会显示一个警告讯息:

# 『tar: Removingleading `/' from member names』那是关于绝对路径的特殊设定。

 

范例二:查阅上述 /tmp/etc.tar.gz 档案内有哪些档案?

[root@linux ~]# tar -ztvf /tmp/etc.tar.gz

# 由于我们使用 gzip 压缩,所以要查阅该 tar file 内的档案时,

# 就得要加上 z 这个参数了!这很重要的!

 

范例三:将 /tmp/etc.tar.gz 档案解压缩在/usr/local/src 底下

[root@linux ~]# cd /usr/local/src

[root@linux src]# tar -zxvf /tmp/etc.tar.gz

# 在预设的情况下,我们可以将压缩档在任何地方解开的!以这个范例来说,

# 我先将工作目录变换到/usr/local/src 底下,并且解开 /tmp/etc.tar.gz ,

# 则解开的目录会在/usr/local/src/etc 呢!另外,如果您进入 /usr/local/src/etc

# 则会发现,该目录下的档案属性与/etc/ 可能会有所不同喔!

 

范例四:在 /tmp 底下,我只想要将/tmp/etc.tar.gz 内的 etc/passwd 解开而已

[root@linux ~]# cd /tmp

[root@linux tmp]# tar -zxvf /tmp/etc.tar.gz etc/passwd

# 我可以透过 tar -ztvf 来查阅 tarfile 内的文件名称,如果单只要一个档案,

# 就可以透过这个方式来下达!注意到! etc.tar.gz 内的根目录 / 是被拿掉了!

 

范例五:将 /etc/ 内的所有档案备份下来,并且保存其权限!

[root@linux ~]# tar -zcvpf /tmp/etc.tar.gz /etc

# 这个 -p 的属性是很重要的,尤其是当您要保留原本档案的属性时!

 

范例六:在 /home 当中,比 2005/06/01新的档案才备份

[root@linux ~]# tar -N '2005/06/01'-zcvf home.tar.gz /home

 

范例七:我要备份 /home, /etc ,但不要/home/dmtsai

[root@linux ~]# tar --exclude /home/dmtsai -zcvfmyfile.tar.gz /home/* /etc

 

范例八:将 /etc/ 打包后直接解开在 /tmp 底下,而不产生档案!

[root@linux ~]# cd /tmp

[root@linux tmp]# tar -cvf - /etc | tar -xvf -

# 这个动作有点像是 cp -r/etc /tmp 啦~依旧是有其有用途的!

# 要注意的地方在于输出档变成 - 而输入档也变成 - ,又有一个 | 存在~

# 这分别代表 standardoutput, standard input 与管线命令啦!

# 这部分我们会在 Bashshell 时,再次提到这个指令跟大家再解释啰!

 

 

NAME

       tar - The GNU versionof the tar archiving utility

 

SYNOPSIS

       tar <operation>[options]

 

       Operations:

       [-]A --catenate--concatenate

       [-]c --create

       [-]d --diff --compare

       [-]r --append

       [-]t --list

       [-]u --update

       [-]x --extract --get

       --delete

 

       Common Options:

       -C, --directory DIR

       -f, --file F

       -j, --bzip2

       -p, --preserve-permissions

       -v, --verbose

       -z, --gzip

 

       All Options:

       [  --atime-preserve  ]  [-b, --blocking-factor N ] [ -B, --read-full-records ] [ --backup BACKUP-TYPE ][ --block-

       compress ] [ -C,--directory DIR ] [ --check-links ] [ --checkpoint ] [ -f, --file[HOSTNAME:]F  ]  [ -F,  --info-

       script  F --new-volume-script  F  ] [  --force-local   ] [ --format FORMAT ] [ -g,--listed-incremental F ] [ -G,

       --incremental ] [--group GROUP ] [ -h, --dereference ] [ --help ] [ -i,  --ignore-zeros  ] [  --ignore-case  ]  [

      --ignore-failed-read  ]  [ --index-file FILE ] [ -j, --bzip2 ] [ -k,--keep-old-files ] [ -K, --starting-file F ] [

       --keep-newer-files ] [-l, --one-file-system ] [ -L, --tape-length N ] [ -m, --touch,--modification-time ]  [  -M,

       --multi-volume  ] [  --mode  PERMISSIONS ] [ -N, --after-date DATE, --newer DATE ] [ --newer-mtime DATE ] [ --no-

       anchored ] [--no-ignore-case ] [ --no-recursion ] [ --no-same-permissions ] [ --no-wildcards]  [ --no-wildcards-

       match-slash  ] [ --null    ] [ --numeric-owner ] [ -o, --old-archive, --portability,--no-same-owner ] [ -O, --to-

       stdout ] [ --occurrenceNUM ] [ --overwrite ] [ --overwrite-dir ] [ --owner USER ] [ -p, --same-permissions,--pre-

       serve-permissions  ] [  -P,  --absolute-names  ] [  --pax-option  KEYWORD-LIST ] [ --posix ] [ --preserve ] [-R,

       --block-number ] [--record-size SIZE ] [ --recursion ] [ --recursive-unlink ] [ --remove-files]  [ --rmt-command

       CMD  ] [  --rsh-command  CMD  ][ -s, --same-order, --preserve-order ] [ -S, --sparse ] [ --same-owner ] [--show-

       defaults ] [--show-omitted-dirs ] [ --strip-components NUMBER, --strip-path NUMBER (1) ] [--suffix SUFFIX ] [ -T,

       --files-from  F ] [ --totals   ] [ -U, --unlink-first ] [--use-compress-program PROG ] [ --utc ] [ -v, --verbose ]

       [ -V, --label NAME ] [--version  ] [ --volno-file F ] [ -w,--interactive, --confirmation ] [ -W,  --verify  ]  [

       --wildcards ]  [  --wildcards-match-slash  ] [  --exclude PATTERN ] [ -X,--exclude-from FILE ] [ -Z, --compress,

       --uncompress ] [ -z,--gzip, --gunzip, --ungzip ] [ -[0-7][lmh] ]

 

(1)   tar-1.14 uses --strip-path,tar-1.14.90+ uses --strip-components

 

DESCRIPTION

       This manual pagedocuments the GNU version of tar, an archiving program designed to store andextract files from an

       archive  file known  as  a tarfile.  A tarfile may be made ona tape drive, however, it is also common to write a

       tarfile to a normalfile.  The first argument to tar must beone of the options Acdrtux, followed by any  optional

       functions.  The final arguments to tar are the names ofthe files or directories which should be archived.  The use

       of a directory namealways implies that the subdirectories below should be included in the archive.

 

EXAMPLES

       tar -xvf foo.tar

              verboselyextract foo.tar

 

       tar -xzf foo.tar.gz

              extract gzippedfoo.tar.gz

 

       tar -cjf foo.tar.bz2bar/

              create bzippedtar archive of the directory bar called foo.tar.bz2

 

       tar -xjf foo.tar.bz2 -Cbar/

              extract bzippedfoo.tar.bz2 after changing directory to bar

 

       tar -xzf foo.tar.gzblah.txt

              extract the file blah.txt fromfoo.tar.bz2

 

 

FUNCTION LETTERS

       One of the followingoptions must be used:

 

       -A, --catenate,--concatenate

              append tar filesto an archive

 

       -c, --create

              create a newarchive

 

       -d, --diff, --compare

              find differencesbetween archive and file system

 

       -r, --append

              append files tothe end of an archive

 

       -t, --list

              list thecontents of an archive

 

       -u, --update

              only append files that are newerthan the existing in archive

 

       -x, --extract, --get

              extract filesfrom an archive

 

       --delete

              delete from thearchive (not for use on mag tapes!)

 

COMMON OPTIONS

       -C, --directory DIR

              change todirectory DIR

 

       -f, --file [HOSTNAME:]F

              use archive fileor device F (default "-", meaning stdin/stdout)

 

       -j, --bzip2

              filter archivethrough bzip2, use to decompress .bz2 files

 

       -p,--preserve-permissions

              extract allprotection information

 

       -v, --verbose

              verbosely listfiles processed

 

       -z, --gzip, --ungzip

              filter thearchive through gzip

 

ALL OPTIONS

       --atime-preserve

              don’t changeaccess times on dumped files

 

       -b, --blocking-factor N

              block size ofNx512 bytes (default N=20)

 

       -B, --read-full-blocks

              reblock as weread (for reading 4.2BSD pipes)

 

       --backup BACKUP-TYPE

              backup filesinstead of deleting them using BACKUP-TYPE simple or numbered

 

       --block-compress

              block the outputof compression program for tapes

 

       -C, --directory DIR

              change todirectory DIR

 

       --check-links

              warn if numberof hard links to the file on the filesystem mismatch the number  of links  recorded  in  the

              archive

 

       --checkpoint

              print directorynames while reading the archive

 

       -f, --file [HOSTNAME:]F

              use archive fileor device F (default "-", meaning stdin/stdout)

 

       -F, --info-script F--new-volume-script F

              run script atend of each tape (implies --multi-volume)

 

       --force-local

              archive file is local even if has a colon

 

       --format FORMAT

              selects outputarchive format

              v7 - Unix V7

              oldgnu - GNU tar<=1.12

              gnu - GNU tar1.13

              ustar -POSIX.1-1988

              posix - POSIX.1-2001

 

       -g,--listed-incremental F

             create/list/extract new GNU-format incremental backup

 

       -G, --incremental

             create/list/extract old GNU-format incremental backup

 

       -h, --dereference

              don’t dump symlinks; dump the files theypoint to

 

       --help like thismanpage, but not as cool

 

       -i, --ignore-zeros

              ignore blocks ofzeros in archive (normally mean EOF)

 

       --ignore-case

              ignore case whenexcluding files

 

       --ignore-failed-read

              don’t exitwith non-zero status on unreadable files

 

       --index-file FILE

              send verboseoutput to FILE instead of stdout

 

       -j, --bzip2

              filter archivethrough bzip2, use to decompress .bz2 files

 

       -k, --keep-old-files

              keep existingfiles; don’t overwrite them from archive

 

       -K, --starting-file F

              begin at file Fin the archive

 

       --keep-newer-files

              do not overwritefiles which are newer than the archive

 

       -l, --one-file-system

              stay in localfile system when creating an archive

 

       -L, --tape-length N

              change tapesafter writing N*1024 bytes

 

       -m, --touch, --modification-time

              don’t extractfile modified time

 

       -M, --multi-volume

             create/list/extract multi-volume archive

 

       --mode PERMISSIONS

              applyPERMISSIONS while adding files (see chmod(1))

 

       -N, --after-date DATE,--newer DATE

              only store filesnewer than DATE

 

       --newer-mtime DATE

              like --newer,but with a DATE

 

       --no-anchored

              match anysubsequenceof the name’s components with --exclude

 

       --no-ignore-case

              use case-sensitive matching with--exclude

 

       --no-recursion

              don’t recurseinto directories

 

       --no-same-permissions

              apply user’sumask when extracting files instead of recorded permissions

 

       --no-wildcards

              don’t usewildcards with --exclude

 

      --no-wildcards-match-slash

              wildcards do notmatch slashes (/) with --exclude

 

       --null --files-fromreads null-terminated names, disable --directory

 

       --numeric-owner

              always usenumbers for user/group names

 

       -o, --old-archive,--portability

              like--format=v7; -o exhibits this behavior when creating an archive (deprecatedbehavior)

 

       -o, --no-same-owner

              do not attemptto restore ownership when extracting; -o exhibits this behavior when extractingan archive

 

       -O, --to-stdout

              extract files tostandard output

 

       --occurrence NUM

              process only NUMoccurrences of each named file; used with --delete, --diff, --extract, or--list

 

       --overwrite

              overwriteexisting files and directory metadata when extracting

 

       --overwrite-dir

              overwritedirectory metadata when extracting

 

       --owner USER

              change owner of extraced files toUSER

 

       -p, --same-permissions,--preserve-permissions

              extract allprotection information

 

       -P, --absolute-names

              don’t stripleading ‘/’s from file names

 

       --pax-optionKEYWORD-LIST

              used only withPOSIX.1-2001 archives to modify the way tar handles extended header keywords

 

       --posix

              like--format=posix

 

       --preserve

              like--preserve-permissions --same-order

 

       -R, --record-number

              show recordnumber within archive with each message

 

       --record-size SIZE

              use SIZE bytesper record when accessing archives

 

       --recursion

              recurse intodirectories

 

       --recursive-unlink

              remove existingdirectories before extracting directories of the same name

 

       --remove-files

              remove filesafter adding them to the archive

 

       --rmt-command CMD

              use CMD insteadof the default /usr/sbin/rmt

 

       --rsh-command CMD

              use remote CMDinstead of rsh(1)

 

       -s, --same-order,--preserve-order

              list of names toextract is sorted to match archive

 

       -S, --sparse

              handle sparsefiles efficiently

 

       --same-owner

              create extractedfiles with the same ownership

 

       --show-defaults

              display thedefault options used by tar

 

       --show-omitted-dirs

              printdirectories tar skips while operating on an archive

 

       --strip-componentsNUMBER, --strip-path NUMBER

              strip NUMBER ofleading components from file names before extraction

 

              (1) tar-1.14uses --strip-path, tar-1.14.90+ uses --strip-components

 

       --suffix SUFFIX

              use SUFFIX instead of default ’~’when backing up files

 

       -T, --files-from F

              get names toextract or create from file F

 

       --totals

              print totalbytes written with --create

 

       -U, --unlink-first

              remove existing files before extractingfiles of the same name

 

       --use-compress-programPROG

              access thearchive through PROG which is generally a compression program

 

       --utc  display file modification dates in UTC

 

       -v, --verbose

              verbosely listfiles processed

 

       -V, --label NAME

              create archivewith volume name NAME

 

       --version

              print tarprogram version number

 

       --volno-file F

              keep track ofwhich volume of a multi-volume archive its working in FILE; used with--multi-volume

 

       -w, --interactive,--confirmation

              ask forconfirmation for every action

 

       -W, --verify

              attempt toverify the archive after writing it

 

       --wildcards

              use wildcardswith --exclude

 

       --wildcards-match-slash

              wildcards matchslashes (/) with --exclude

 

       --exclude PATTERN

              exclude filesbased upon PATTERN

 

       -X, --exclude-from FILE

              exclude fileslisted in FILE

 

       -Z, --compress,--uncompress

              filter thearchive through compress

 

       -z, --gzip, --gunzip,--ungzip

              filter thearchive through gzip

 

       --use-compress-programPROG

              filter the archive through PROG (whichmust accept -d)

 

       -[0-7][lmh]

              specify driveand density

 

BUGS

       The  GNU folks,  in general, abhor manpages, and create info documents instead. The maintainer of tar falls into

       this category.  Thus this man page may not be complete, norcurrent, and was included  in  the Red  Hat  CVS tree

       because  man is  a  great tool  :).   This man page was first taken from DebianLinux and has since been lovingly

       updated here.

 

REPORTING BUGS

       Please report bugs viahttps://bugzilla.redhat.com

 

SEE ALSO

       The full documentationfor tar is maintained as a Texinfo manual. If  the  info and  tar  programs are  properly

       installed at your site,the command

 

              info tar

 

       should give you accessto the complete manual.

 

AUTHORS

       Debian Linuxhttp://www.debian.org/

       Mike Frysinger<vapier@gentoo.org>

 

GNU                                                      Oct 2004                                                  TAR(1)





  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值