1 / 15

Work Station Command

Work Station Command. Shun-Hsun Yang Advanced Reliable Systems (ARES) Laboratory Department of Electrical Engineering National Central University Jungli, Taiwan. Unix Command Introduction. cp 拷貝檔案 -r : recursive 使用於 copy 整個目錄 ( 連目錄底下的子目錄一起 copy) Ex : cp source file target

catori
Download Presentation

Work Station Command

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Work Station Command Shun-Hsun Yang Advanced Reliable Systems (ARES) Laboratory Department of Electrical Engineering National Central University Jungli, Taiwan

  2. Unix Command Introduction • cp 拷貝檔案 • -r : recursive 使用於copy整個目錄(連目錄底下的子目錄一起copy) • Ex : • cp source filetarget • cp -r source directorytarget • rm 刪除檔案 • -r : • Ex : rm -r directory(會一一詢問哪些檔案要刪除) • \rm -ri directory(不詢問,直接刪除目錄及目錄底下所有檔案) • mv移動檔案 • Ex: mv source filetarget file(可用來改檔名)

  3. cd 切換目錄 • mkdir 建立目錄 • pwd 列出目前目錄 • Ex : [cae09]/usr2/grad94/gohun <gohun> mkdir hello [cae09]/usr2/grad94/gohun <gohun> cd hello cae09% /usr2/grad94/gohun/hello ( 4 )> pwd /usr2/grad94/gohun/hello cae09% /usr2/grad94/gohun/hello ( 5 )> cd ~ cae09% /usr2/grad94/gohun ( 6 )> cd ../.. cae09% /usr2 ( 7 )> cd /usr2/grad94/gohun cae09% /usr2/grad94/gohun ( 8 )> cd ~dididog/ cae09% /usr2/grad94/dididog ( 9 )>

  4. ls list縮寫,顯示目錄底下的檔案 • -a : 列出包含以“.”起始的隱藏檔的所有檔案與目錄 • -t : 依照檔案最後修改的時間排列,依序列出所有檔案與目錄 • -l : 列出目錄底下所有檔案的許可權(privilege)、擁有者(owner)、大小(Size)、修改時間(Revise date)與名稱。  • Ex: cae18% /usr2/grad94/gohun/good ( 51 )> ls debussyLog/ ha.v test_ha.v testha.dmp cae18% /usr2/grad94/gohun/good ( 52 )> ls -a ./ ../ debussyLog/ ha.v test_ha.v testha.dmp cae18% /usr2/grad94/gohun/good ( 53 )> ls -al total 22 drwxr-xr-x 3 gohun grad94 512 Jul 22 23:03 ./ drwxr-xr-x 45 gohun grad94 5632 Jul 22 22:53 ../ drwxr-xr-x 2 gohun grad94 512 Jul 22 23:03 debussyLog/ -rw-r--r-- 1 gohun grad94 113 Jul 22 23:03 ha.v -rw-r--r-- 1 gohun grad94 247 Jul 22 23:03 test_ha.v -rw-r--r-- 1 gohun grad94 567 Jul 22 23:03 testha.dmp

  5. chmod 改變檔案的存取權限模式 • u : user’s permissions g : group’s permissions o : other’s permissions • a : all permissions(user,group,and other) • r : read permission w : write permission x : execute permission • d : directory • User Group Other • Drwx rwx rwx • Ex : • -rw-r--r-- 1 gohun grad94 1153 Dec 8 2005 clk.sp • cae09% /usr2/grad94/gohun/homework ( 14 )> chmod g+x clk.sp • cae09% /usr2/grad94/gohun/homework ( 15 )> ls –l • -rw-r-xr-- 1 gohun grad94 1153 Dec 8 2005 clk.sp* • cae09% /usr2/grad94/gohun/homework ( 16 )> chmod o-r clk.sp • cae09% /usr2/grad94/gohun/homework ( 17 )> ls -l • -rw-r-x--- 1 gohun grad94 1153 Dec 8 2005 clk.sp*

  6. | pipe,表示一起執行 • grep  搜尋檔案字串,並列出該行 • ps 顯示目前所有使用者的系統處理程序 • -a : print information about all processes most frequently • -e : print information about every processes now running • -f : Generate a full listing • Ex : ps -aef |grep quamtum • User name PID PPID START TTY TIME COMMAND • gohun 11679 11677 0 09:05:12 pts/7 0:00 /bin/tcsh • gohun 12226 11273 4 09:42:07 pts/4 0:03 /usr/verdi • prstat 能看到 load averages: 0.00, 0.01, 0.01 • top 能看到 CPU usage 以及memory usage

  7. kill 砍當掉的程式 • -9 : 強制砍 • Ex : ps -aef |grep gohun • User name PID PPID START TTY TIME COMMAND • gohun 3735 3710 0 10:02:48 ?? 0:00 /usr/dt/bin/dtterm -session dtakaOgg • gohun 3664 1 0 10:02:40 ? 0:00 /usr/dt/bin/dsdm • gohun 3749 3735 0 10:02:50 pts/9 0:00 /bin/tcsh • kill 3735 • kill -9 3735 • 砍掉所有job並登出 • kill -9 -1

  8. who 列出正在用此工作站的人 User TTY TIME longxi console Jul 3 20:24 (:0) gohun pts/14 Jul 4 13:10 (cae27) lien pts/12 Jul 3 23:01 (cae27) apon458 dtremote Jul 4 10:49 (140.115.71.88:0) whoami 列出自己的user name finger 查詢該user的資料,可列出姓名

  9. du 列出該目錄下使用的硬碟容量 -k 以Kbyte顯示 [cae25]/usr2/grad94/gohun/homework/testing <gohun>du -k 25 ./debussyLog 29886 . df 列出所有分割區的使用量 -k 以Kbyte顯示 [cae25]/usr2/grad94/gohun/homework/testing <gohun> df -k Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 2005901 1617415 328309 84% / /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd swap 1106664 8 1106656 1% /var/run swap 1123288 16632 1106656 2% /tmp quota –v 列出硬碟配額量 [cae25]/usr2/grad94/gohun/homework/testing <gohun> quota -v Disk quotas for quamtum (uid 1103): Filesystem usage quota limit timeleft files quota limit timeleft /usr2 493051 900000 1000000 11211 0 0

  10. Compress Tools • .tar 把目錄封裝起來 • .Z .gz .bz2 三種壓縮格式 • 壓縮 • tar cvf directoryname.tar directoryname • compress –v filename.tar(壓縮後的檔名為filename.tar.Z) • gzip filename.tar(壓縮後的檔名為filename.tar.gz) • bzip2 filename.tar(壓縮後的檔名為filename.tar.bz2) • 解壓縮 • tar -xvf filename.tar • compress -d filename.tar.Z • gunzip filename.tar.gz • bunzip2 filename.tar.bz2

  11. Shell File • .cshrc source ~/CSHRC source ~/.aliases alias ee 'telnet bbs.ee.ncu.edu.tw' • CSHRC #verilog source /usr/cadence/cic_setup/ldv.csh source /usr/cadence/cic_setup/ic.csh #source /usr/cadence/cic_setup/dsmse.csh #source /usr/cadence/cic_setup/icc.csh #source /usr/cadence/cic_setup/psd.csh #source /usr/cadence/cic_setup/ambit.csh source /usr/cadence/cic_setup/license.csh

  12. Server Note • 碩一 quota 2G • 碩二 quota 4G • No lock screen • /tmp 不是無限大,有大job請洽root • License 由cic控制,root只能告知有無過期 • tcsh下可用tab鍵補字

  13. 簡單障礙處理 • 檢查CSHRC • cp 同學的CSHRC • TOOL設定檔 • ROOT確認TOOL正常與否 • 不正常,修復後PO版 • 正常,不理你

  14. ROOT職責 • 確認系統正常與否 • 確認TOOL正常與否 • 不定期備份 • 停機公告 • ROOT不負責的項目 • 教學TOOL使用 • 解決作業問題 • 網路遠端問題

  15. 明天考試!!!

More Related