1 / 21

UNIX

UNIX. Basic System Administration. Agenda. 系統管理者的職責與角色 基本觀念及操作 作業系統管理 網路系統管理 Q&A. 系統管理者的職責與角色. 例行工作的規劃 週邊設備增減之規劃 使用者帳號的管理 備份資料方式與規劃 應用軟體的新增與更版 各種故障的排除與記錄 系統文件的管理. 基本觀念及操作. UNIX System Structure. 基本觀念及操作. UNIX File Structure. 基本觀念及操作. ls : 顯示目前的檔案內容

hao
Télécharger la présentation

UNIX

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. UNIX Basic System Administration

  2. Agenda • 系統管理者的職責與角色 • 基本觀念及操作 • 作業系統管理 • 網路系統管理 • Q&A UNIX (Basic System Administration)

  3. 系統管理者的職責與角色 • 例行工作的規劃 • 週邊設備增減之規劃 • 使用者帳號的管理 • 備份資料方式與規劃 • 應用軟體的新增與更版 • 各種故障的排除與記錄 • 系統文件的管理 UNIX (Basic System Administration)

  4. 基本觀念及操作 UNIX System Structure UNIX (Basic System Administration)

  5. 基本觀念及操作 UNIX File Structure UNIX (Basic System Administration)

  6. 基本觀念及操作 • ls : 顯示目前的檔案內容 • ls [options] [directory] • Example • ls –lia • ls –F • File System • i-node, 一個檔案即佔一個i-node • 目錄(directory)也是一種特殊形態的檔案 • Sample: UNIX (Basic System Administration)

  7. 基本觀念及操作 • Sample : • -rwxr-xr-x 2 cslu user 3217 Jun 22 08:28 showenv -rw-r--r-- 1 root root 261794 Jun 22 12:23 chdrvfont.tar.gz drwxr-xr-x 2 root root 4096 Jun 22 14:53 chinese lrwxrwxrwx 1 root root 13 Jun 22 08:28 S85gpm -> ../init.d/gpm -rwxr-xr-x 1 root root 933 Sep 12 1999 rc.local brw-rw---- 1 root disk 3, 0 May 6 1998 hda brw-rw---- 1 root disk 3, 1 May 6 1998 hda1 crw-rw-rw- 1 root root 1, 3 May 6 1998 null 3 4 5 6 7 1 2 UNIX (Basic System Administration)

  8. 基本觀念及操作 • File System • 1檔案特性及使用權限 • 2link的數目,若為目錄則為內含的目錄數 • 3擁有者(owner) • 4群組(group) • 5檔案大小 • 6最後修改日期 • 7檔案名稱 • 目錄可視為一個特別的檔案 UNIX (Basic System Administration)

  9. 基本觀念及操作 • chmod – 變更檔案的使用權限 • # chmod uog+x prog1 • # chmod uog-r doc1 • chown – 變更檔案的所有人 • # chown cslu text1 • # chown cslu:users text2 • # chown –R cslu:users dir01 • chgrp – 變更檔案的群組 • # chgrp root protect01.txt UNIX (Basic System Administration)

  10. 基本觀念及操作 • cd : 變換目錄 • 只輸入cd,會回到 home directory ($HOME) • Example • cd /etc/rc.d • cd ../../var/log • cd messages • pwd – print working directory • 顯示目前的工作目錄 UNIX (Basic System Administration)

  11. 基本觀念及操作 • clear • 將目前螢幕上的資料清掉, 相當於DOS中的cls • cat • 將檔案顯示出來 / 合併檔案 • Example • cat ./.cshrc • cat /var/log/messages • cat /var/log/messages /etc/fstab > /tmp/aaa.txt • cat UNIX (Basic System Administration)

  12. 基本觀念及操作 • cp – 拷貝檔案 • # cp <src> <dist> • # cp –R <src> <dist> • mv – 搬移檔案 • # mv <src> <dist> • mkdir / rmdir – 建立目錄 / 刪除目錄 • # mkdir <dir> • rm – 刪除檔案 • # rm <file> • # rm –rf <file> / <dir> UNIX (Basic System Administration)

  13. 基本觀念及操作 • shutdown – 關機 • # shutdown –h now • # shutdown –k 3 System Reboot • # shutdown –r 5 System Reboot • reboot – 重新啟動 • halt – 關機 • # init s – 重新開啟到Single User Mode • sync – 將檔案系統暫存器中的資料寫入硬碟,避免重新開機後的資料不一致 UNIX (Basic System Administration)

  14. 基本觀念及操作 • 安全的關機指令 • # sycn;sync;halt • telnet – 遠端連線工具 • # telnet [<hostname>] [<port>] • Example : • # telnet www.nchu.edu.tw • # telnet www.nchu.edu.tw 80 • ftp – 檔案傳輸工具 • # ftp [<hostname>] • man – 線上手冊查詢工具 • Example : • # man [ <keyword> ] UNIX (Basic System Administration)

  15. 作業系統管理 • 使用者管理 • adduser • /etc/passwd (/etc/shadow) • passwd • /etc/skel • 硬碟分配 • df – report the summary of disk blocks and inodes free and in user • /etc/fstab • mount / umount • du – report amount of disk space in use UNIX (Basic System Administration)

  16. 作業系統管理 • 新增硬碟空間 • Hardware Connection • Partition Disk • Format • mount • 系統服務 • standalone / inetd • inetd / xinetd • ps – show status of active process • kill –HUP <pid> (1)kill –TERM <pid> (9) UNIX (Basic System Administration)

  17. 作業系統管理 • 搬移/備份資料 • cp – copy file • tar – tape archiver; refer to man pages for details on creating, listing, and retriving from archive files. Tar files can be stored on tabe or disk.# tar cvf - /home/abc | (cd /mnt/disk; tar xvf -) • NFS – Network File System • /etc/exports • mount host(ip-address):/fs1 fs2 UNIX (Basic System Administration)

  18. 作業系統管理 • Other Utilities • finger – report information about users on local and remote machines • grep – search the argument (in this case probably a file) for all occurrences of the search string, and list them. • more – page through a text file • tail – display the last few lines (or parts) of a file UNIX (Basic System Administration)

  19. 作業系統管理 • wc – display word (or character or line) count for file(s) • who – report who is logged in and what processes are running • rm – remove (delete) a file or directory (-r recursively deletes the directory and its contents) (-i prompts before removing files) UNIX (Basic System Administration)

  20. 網路系統管理 • 本機 IP 設定檔 • /etc/hosts • ifconfig <device> / <options> • ping <host>/<ip-address> • traceroute <host>/<ip-address> • telnet host [port] • netstat • netstat –na [ | grep <patten> ] [ | more ] • netstat -rn UNIX (Basic System Administration)

  21. Q. & A.

More Related