antlinux命令行的简单介绍( 四 )


:wq 保存文件并退出vi
:wq! 强制保存文件,并退出vi
q: 不保存文件,退出vi
:q! 不保存文件,强制退出vi
:e! 放弃所有修改,从上次保存文件开始再编辑
chmod
change mode,变更文件或目录的读、写、运行权限
chmod [-cfvR] [--help] [--version] mode file...
mode:权限设定字串,格式如下 : [ugoa...][[+-=][rw xX ]...][,...]
u 表示该档案的拥有者,g 表示与该档案的拥有者属于同一个群体(group)者 , o 表示其他以外的人,a 表示这三者皆是
+ 表示增加权限、- 表示取消权限、= 表示唯一设定权限 。
r 表示可读取 , w 表示可写入,x 表示可执行,X 表示只有当该档案是个子目录或者该档案已经被设定过为可执行 。
chmod也可以用数字来表示权限,语法为:chmod abc file,如chmod 777 file
其中a,b,c各为一个数字,分别表示User、Group、及Other的权限 。r=4,w=2,x=1
chmod 777 file,等同于 chmod a=rwx file
chmod ug=rwx,o=x file,等同于 chmod 771 file
chmod 4755 filename,可使此程序具有root的权限
ls -l 可以查看列出当前用户的文件权限
zip
zip -r filename.zip filesdir
zip -r test.zip ./_把当前所有文件压缩到test.zip
zip -r test.zip test,把test文件所有文件及目录,要是到test.zip
zip -d test.zip test.txt,删除压缩文件中test.txt文件
zip -m test.zip ./test.txt,向压缩文件中test.zip中添加test.txt文件
zip -r test.zip file1 file2 file3 filesdir,处理多个文件和目录,空格隔开
unzip
unzip zip-file,解压到当前目录
unzip -d dst-dir zip-file , 解压到指定的目录,-d后为指定目录
unzip -n zip-file,不覆盖已经存在的文件,-n为不要覆盖原有的文件
unzip -n -d dst-dir zip-file , 解压到指定的目录,不覆盖已经原有的文件
unzip -o -d dst-dir zip-file,-o不必先询问用户覆盖原有文件
unzip -l zip-file,仅查看压缩文件内所包含的文件
tar
tar cvf test.tar test,把test下所有文件和目录做备份tar czvf test.tar.gz test,把test下所有文件和目录做备份并进行压缩tar xzvf test.tar.gz,把这个备份文件还原并解压缩tar tvf test.tar | more,查看备份文件的内容 , 并以分屏方式显示在显示器上
tar czvf test.tar.gz test --exclude=test/svn,备份压缩并排除目录
touch
如何在linux下配置ant去运行svn相关任务如果linux上已经装有了svn命令行工具的话,那么就可以直接按照把svnant里面的相关的jar放到ant的lib目录下使用就可以了 。
其内容如下:
Making SvnAnt use JavaSVN
Step-by-step instructions:
Remove existing javahl.jar and svnClientAdapter.jar (libraries distirbuted with the svnant) from your Ant classpath (ANT_HOME/lib/ directory).
Download latest version of JavaSVN library. You will need javasvn.jar and javasvn-javahl.jar files from the library distribution.
Get patched version of svnClientAdapter.jar (version 0.9.32).
Put javasvn.jar, javasvn-javahl.jar and svnClientAdapter-0.9.32.jar files on your Ant classpath (ANT_HOME/lib/ directory).
After performing the steps above svnant will use JavaSVN instead of JavaHL bindings.
linux系统基本操作命令 linux下基本命令使用讲解1、文件与文件夹(目录)操作命令
1)rm:删除命令
例:$ rm -i 文件名-------------有询问“Y/N”; rm -r 文件名 ---------------删除该文件夹和子目录下的所有文件;
例:$ rm -f 文件名------------- 直接删除,不询问
2) mv:移动目录或文件,还可以重命名
例:$ mv text /zzz -------------将text移动到zzz目录下;

推荐阅读