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 的帐号
passwrod: 输入使用者 user 的密码,不执行初始化文件。
$ su - user 进入使用者 user 的帐号
passwrod: 输入使用者 user 的密码,执行初始化文件。
(3)查看当前用户名:
执行格式: who am i 查看 login 时,自己的 username。
执行格式: whoami 查看目前的 username。若已执行过 "su"命令(switch user),
则显示出此 user 的 username。
(4)查看目前系统上所有主机的使用者:
执行格式: rusers
=> 结束
与某主机上的终端用户交谈:
执行格式: talk username@hostname 或 talk username@ip_address
Example:
1. 可先利用 rusers 指令查看网路上的使用者
2. 假设自己的帐号是 u84987 ,在主机 indian 上使用,现在想要与 doc 上的
u84123 交互。
$talk u84123@doc ==> 此时萤幕上将会出现等待画面
在对方(u84123)萤幕上将会出现下列讯息
Message from Talk_Daemon@Local_host_name at xx:xx
talk: connection requested by u84987@indian
talk: respond with: talk u84987@indian
此时对方(u84123) 必须执行 talk u84987@indian 即可互相交互。
最後可按结束。
[i:044ce4a866][/i:044ce4a866]
【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】
kokulgp 回复于:2003-12-26 09:48:54 |
谢拉,收藏 |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/