30)history
=======
?设定命令记录表之长度
======================
执行格式 set history = n
Example:
%set history = 40
设定命令记录表之长度为 40 (可记载执行过之前面 40 个命令)
?查看命令记录表之内容
======================
执行格式 history
?使用命令记录表
================
执行格式 !!
Example: %!! (重覆执行前一个命令)
执行格式 !n ( n 为命令记录表之命令编号 )
Example: %!5 ( 执行命令记录表中第五个命令 )
执行格式 !string ( 重覆前面执行过以 string 为起始字元之命令 )
Example: %!cat ( 重覆前面执行过 以 cat 为起始字元之命令 )
Example: %!cat ( 重覆前面执行过 以 cat 为起始字元之命令 )显示前一个命令之内容
======================
执行格式 !! p
?更改前一命令之内容并执行之
============================
执行格式 ^oldstring ^newstring
将前一命令中 oldstring 的部份 改成 newstring 并执行之
Example:
%find . -name file1.c -print
^file1.c^core
%find . -name core -print
注 档案 core 为执行程式或命令发生错误时 系统所产生的档案 作为侦错(debug)之用 因其所占空间极大 通常将之删除
31)资料之压缩
==========
为了避免不常用的档案或资料 占用太大的磁碟空间 请使用者将之压缩 欲使用压缩过
的档案或资料前 将之反压缩 即可还原成原来之资料型式 凡是经过压缩处理之档案
会在档名後面附加 " .Z " 之字元 表示此为一压缩档案
?压缩资料
==========
执行格式 compress filename 压缩档案
执行格式 compressdir directory-name 压缩目录
?解压缩还原资料
================
执行格式 uncompress filename 反压缩档案
执行格式 uncompressdir directory-name 反压缩目录
pipe-line 之使用
================
执行格式 command1 | command2
将 command1 执行结果 送到 command2 做为 command2 的输入
Example:
%ls -Rl | more
以分页方式 列出目前目录下所有档案 及子目录之名称
%cat file1 | more
以分页方式 列出档案 file1 之内容
32)I/O control
===========
?标准输入之控制
================
执行格式 command-line < file
将 file 做为 command-line 之输入
Example:
%mail -s "mail test" user@iis.sinica.edu.tw < file1
将档案 file1 当做信件之内容 Subject 名称为 mail test,送给收信人
?标准输出之控制
================
执行格式 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 中
33)查看系统中的使用者
===================
执行格式 who 或 finger
执行格式 w
执行格式 finger username or finger username@domainname
改变自己的 username 进入其他使用者的帐号 拥有其使用权利
=========================================================
执行格式 su username
Example:
%su user 进入使用者 user 之帐号
passwrod: 输入使用者 user 之密码
34)查看 username
==============
执行格式 who am i 查看 login 时 自己的 username
执行格式 whoami 查看目前的 username 若已执行过 "su"命令(switch user)
则显示出此 user 之 username
查看目前系上所有工作站的使用者:
===============================
执行格式: 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 即可互相交谈
最後可按结束
35)检查远端电脑系统是否正常
========================
执行格式 ping hostname 或 ping IP-Address
Example:
%ping doc
36)电子邮件(E-mail)的使用简介
==========================
本系之 E-mail address 为 ice.ntnu.edu.tw
.将档案当做 E-mail 的内容送出
=============================
执行格式 mail -s "Subject-string" username@address < filename
%mail -s "program" user < file.c
将 file.c 当做 mail 的内容 送至 user, subject name 为 program
.传送 E-mail 给本系使用者
========================
执行格式 mail username
%mail user
.传送 E-mail 至 外地
====================
执行格式 mail username@receiver-address
Example
%mail paul@gate.sinica.edu.tw
Subject : mail test
:
键入信文内容
: