15、文件的压缩
为了避免不常用的文件或文件,占用太大的磁盘空间,请使用者将的压缩。欲使用压缩过的文件或文件前,将其解压,即可还原成原来的文件型式。凡是经过压缩处理的文件,会在文件名後面附加 " .Z " 的字符,表示此为一压缩文件。
(1)压缩文件
执行格式:compress filename 压缩文件
执行格式:compressdir directory-name 压缩目录
(2)解压缩还原文件
执行格式:uncompress filename解压文件
执行格式:uncompressdir directory-name解压目录
管道的使用
================
执行格式:command1 | command2
将 command1 执行结果,送到 command2 做为 command2 的输入。
Example:
$ ls -Rl | more
以分页方式,列出目前目录下所有文件,及子目录的名称。
$ cat file1 | more
以分页方式,列出文件 file1 的内容。
$ ps –ef | grep ora
列出正在执行的包含字符串ora的进程信息。
16、输入输出控制
(1)标准输入的控制
执行格式:command-line < file
将 file 做为 command-line 的输入。
Example:
$mail -s "mail test" user@sina.com < file1
将文件 file1 当做信件的内容,Subject 名称为 mail test,送给收信人。
(2)标准输出的控制
执行格式:command >; filename
将 command 的执行结果,送至指定的 filename 中。
Example:
$ ls -l >; list
将执行 "ls -l" 命令的结果,写入文件 list 中。
执行格式:command >;! filename
同上,若 filename 的文件已经存在,则强迫 overwrite。
Example:
$ ls -lg >;! list
将执行 "ls - lg" 命令的结果,强迫写入文件 list 中。
执行格式:command >;& filename
将 command 执行时,萤幕上所产生的任何讯息,写入指定的 filename 中。
Example:
$ cc file1.c >;& error
将编译 file1.c 文件时,所产生的任何讯息,写入文件 error 中。
执行格式:command >;>; filename
将 command 执行结果,附加(append)到指定的 filename 中。
Example:
$ ls - lag >;>; list
将执行 "ls - lag" 命令的结果,附加(append)到文件 list 中。
执行格式:command >;>;& filename
将 command 执行时,萤幕上所产生的任何讯息,附加於指定的 filename中。
Example:
$ cc file2.c >;>;& error
将编译 file2.c 文件时,萤幕所产生的任何讯息,附加於文件 error 中。
17、系统用户相关操作
(1)查看系统用户
执行格式: who 或 finger
执行格式: w
执行格式: finger username or finger username@domainname
(2)改变帐号,进入其他使用者的帐号,拥有其使用权利。
执行格式: su
Example:
$ su user 进入使用者 user 的帐号
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 材料 培训 执行 文件 格式 filename command Example: |
注册
个人空间
