总说明:
gzip,bzip2只能针对一个文件,而tar是打包没有压缩,可以对多个文件及目录,但tar有gzip及bzip2的压缩功能。bzip2是gzip的升级版,压缩比更高。
winrar只能gzip方式压缩支持解压
用得最多tar加gzip压缩
gzip,bzip2要点说明:
压缩文件时,原文件会消失,解压时,原压缩文件也消失,但用 bzip2 -c man.config > man.config.bz2 可保留原文件,gzip也一样这样用
都是用-d 可以解开文件
zcat,bzcat可以直接读取压缩文件里的内容而不用解压
gzip 档名--压缩;bzip2 -z 档名--压缩
gzip可以被WinRAR 这个windows软体解压缩,但bzip2不行
gzip的后缀是.gz,bzip2的后缀是.bz2
tar要点说明
应用更广,可以打包并压缩,但只有gzip的压缩可以被windows的winrar解压
后缀--只打包.tar,加gzip则.tar.gz,加bzip2则.tar.bz2
-z是通过gzip,-j是通过bzip2
-p 这个选项的原因是为了保存原本档案的权限与属性,可用于备份
压缩:tar -zcv -f filename.tar.bz2 要被压缩的档案或目录名称
查询包里有哪些文件目录:tar -ztv -f filename.tar.bz2
解压缩:tar -zxv -f filename.tar.bz2 -C 欲解压缩的目录
打包后原文件不消失,解包后也不消失
解压tar里的一个文件时 tar -zxv -f /root/etc.tar.bz2 etc/shadow --最后一个是要解开的档名,可以通过tar -ztvf先查看有哪些文件
sudo apt-get install subversion libapache2-svn
安装成功后截图
mkdir -p /home/svn
创建所需要的版本库
cd /home/svn/ sudo svnadmin create 版本库的名字
修改版本库目录的权限
sudo chown -R www-data.www-data 版本库名字
sudo vim /etc/apache2/mods-available/dav_svn.conf
修改后配置文件内容如下
# dav_svn.conf - Example Subversion/Apache configuration # # For details and further options see the Apache user manual and # the Subversion book. # # NOTE: for a setup with multiple vhosts, you will want to do this # configuration in /etc/apache2/sites-available/*, not here. # <Location URL> ... </Location> # URL controls how the repository appears to the outside world. # In this example clients access the repository as http://hostname/svn/ # Note, a literal /svn should NOT exist in your document root. <Location /svn> # Uncomment this to enable the repository DAV svn # Set this to the path to your repository # SVNPath /home/svn # Alternatively, use SVNParentPath if you have multiple repositories under # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...). # You need either SVNPath and SVNParentPath, but not both. SVNListParentPath on SVNParentPath /home/svn # Access control is done at 3 levels: (1) Apache authentication, via # any of several methods. A "Basic Auth" section is commented out # below. (2) Apache <Limit> and <LimitExcept>, also commented out # below. (3) mod_authz_svn is a svn-specific authorization module # which offers fine-grained read/write access control for paths # within a repository. (The first two layers are coarse-grained; you # can only enable/disable access to an entire repository.) Note that # mod_authz_svn is noticeably slower than the other two layers, so if # you don't need the fine-grained control, don't configure it. # Basic Authentication is repository-wide. It is not secure unless # you are using https. See the 'htpasswd' command to create and # manage the password file - and the documentation for the # 'auth_basic' and 'authn_file' modules, which you will need for this # (enable them with 'a2enmod'). AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd # To enable authorization via mod_authz_svn AuthzSVNAccessFile /etc/apache2/dav_svn.authz # The following three lines allow anonymous read, but make # committers authenticate themselves. It requires the 'authz_user' # module (enable it with 'a2enmod'). #<LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user #</LimitExcept> </Location>
注意:
- <Location /svn>与</Location>成对出现
- DAV svn开启DAV模块支持
- SVNPath与SVNParentPath二选其一,不能同时出现,建议使用SVNParentPath,这样可以在SVN的根目录下创建多个svn版本库
- 开启BASIC认证
- 多读一下英文注释,很简单的
sudo htpasswd [-c] /etc/apache2/dav_svn.passwd $username
注意:
- /etc/apache2/dav_svn.passwd是在apache的dav_svn.conf里AuthUserFile指定的文件
- 参数-c,当指定文件不存在时需要该参数创建文件,当指定文件存在时,不需要该参数,否则会覆盖掉原有文件中记录
sudo vim /etc/apache2/dav_svn.authz
创建组并进行读写控制
[groups] haotest1-admin=wangzhengyi haotest1-dev=wangzhengyi,chenshan [haotest1:/] @haotest1-dev=r @haotest1-admin=rw [haotest1:/trunk] @haotest1-dev=rw [haotest1:/tags] @haotest1-admin=rw
- [groups]针对haotest1版本库设置了两个组,一个admin,一个dev
- [haotest1:/]这是haotest1版本库的根目录,针对dev组只有r权限,也就是只能检出,针对admin有rw权限,可以创建,删除,修改等权限
- 点到为止,不明白的google一下,说多了就没意思了
svn co http://192.168.1.1/svn/haozhaotest1 --username wangzhengyi
创建目录并提交
以8888为例
第一步 netstat -aon | findstr 8888
查找8888对应的程序的pid
第二步 tasklist|findstr "pid"
OK 是matlab占用了8888端口
Over!