- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
UNIX 简介.ppt
UNIX 簡介 國立暨南國際大學 計算機與網路中心 研究助理 張克寧 klim@.tw shell 命令編譯器 內部命令: cd, set, unset(與shell種類相關) 外部命令: 外部程式 環境變數 (可用 env 顯示) PATH: 外部執行程式搜尋順序 /usr/bin:/usr/sbin:/usr/ucb:/usr/ccs/bin:. . 表現在目錄, 不建議使用或放在最後 xyz - /usr/bin/xyz- /usr/sbin/xyz - - ./xyz 線上求助 man: 手冊 (manual) ,ex: man wc man -k keyword, 尋找與keyword相關的指令 (系統需建索引檔:windex or whatis, 以catman 建立) 分冊: Vol 1:command, Vol2: system call... cat(1): 表示 cat 在手冊的第一冊 新手可試 man man 環境變數: MANPATH, 內定 /usr/man file system 階層式的檔案架構, 樹狀結構 所有device 都是一個file (special file) 目錄相關指令 ls: 查看目錄, ls [-al] [dir] cd: 更換目錄, cd [dir] pwd:顯示現在目錄 mkdir: 新造目錄, mkdir dir rmdir: 刪除目錄 rmdir dir (dir 需為空的) 目錄相關指令 檔案相關指令 cat: 顯示檔案內容, cat [file1 file2..] more: 一頁一頁顯示檔案內容, more file 編輯器: ed, ex, vi, emacs, joe cp: 複製, cp a b, cp a b c dir rm:刪除, rm a b c mv: 更換檔名或移動檔案 mv a b, mv a b c dir ln: 檔案鏈結, ln [-s] a b, a-- b 檔案相關指令 檔案屬性 $ ls -al total 201 drwxr-xr-x 24 klim sys 1536 Mar 17 16:09 . drwxr-xr-x 12 root other 512 Mar 10 19:49 .. drwxr-xr-x 2 klim sys 512 Mar 6 08:49 Mail drwxr-xr-x 2 klim sys 512 Mar 5 09:14 News -rw-r--r-- 1 klim sys 49259 Mar 14 20:28 kernel -rw 1 klim sys 4820 Mar 16 17:35 mbox 檔案屬性 chmod:更改屬性, chmod mode file1 file2 .. chmod 444 mbox chmod a+r,u+wx,g+x,o-wx mbox mode: octal number, augo[+-]rwx chown: 更改owner, chown user file superuser 方能執行 chgrp: 更改group, chgrp group file 檔案相關指令 head: 列出檔案的前十行, head f1 f2 tail: 列出檔案的後十行, tail f1 f2 grep pattern f1 f2...:列出檔案中包含pattern的那些行 find: 在目錄中尋找符合條件的檔 du: 統計目錄所用空間 df: 列出磁碟機使用情形 檔案相關指令 檔案相關指令 練習 輸出入轉向與pipe cat f1 f2 f3 mail user@address letter ls | wc -w /bin/time ls /dev/null sh: /bin/time ls /dev/null 2 time.out /bin/time ls out 21 csh:/bin/time ls ls.out /bin/time ls out 線上交談 talk user, talk user@hostname write user: 線上送訊 mesg n: 切斷通訊, mesg y 打開通訊 who: 查看線上使用者 w: 查看線上使用情形 程序 (process) ps: 印出程序相關資訊 /bin/ps -ef, /usr/ucb/ps aux 列出所有程序 kill: 送訊號給程序 kill -HUP pid
文档评论(0)