22
Linux 入入入入 ( 入入入 ) 講講 : Pank 2006-02-21 http://pank.org

Linux 入門課程 ( 基礎篇 )

  • Upload
    early

  • View
    75

  • Download
    0

Embed Size (px)

DESCRIPTION

Linux 入門課程 ( 基礎篇 ). 講者 : Pank 2006-02-21 http://pank.org. Install Linux. 選擇 Distro (Distribution) 建議 Fedora Core Linux 或 Mandriva Linux http://ftp.isu.edu.tw/pub/Linux/ 光碟安裝 或 網路安裝 分割硬碟 最精簡的分割法 / 、 swap 進階分割 / 、 /var 、 /usr 、 /home 、 swap 與 Windows 共存 先灌 Windows - PowerPoint PPT Presentation

Citation preview

Page 1: Linux  入門課程 ( 基礎篇 )

Linux 入門課程 ( 基礎篇 )

● 講者 : Pank● 2006-02-21● http://pank.org

Page 2: Linux  入門課程 ( 基礎篇 )

Install Linux

● 選擇 Distro (Distribution)● 建議 Fedora Core Linux 或 Mandriva

Linux– http://ftp.isu.edu.tw/pub/Linux/

● 光碟安裝 或 網路安裝● 分割硬碟 最精簡的分割法 / 、 swap

– 進階分割 / 、 /var 、 /usr 、 /home 、 swap● 與 Windows 共存 先灌 Windows● 選擇安裝套件 全部安裝約 3~4G● 選擇 X Windows 系統 :

GNOME 、 KDE 、 IceWM

Page 3: Linux  入門課程 ( 基礎篇 )

Boot Loader

● Grub– /boot/grub/menu.lst

● Lilo– /etc/lilo.conf

Grub is better

Page 4: Linux  入門課程 ( 基礎篇 )

Run Level

● 0 - halt (Do NOT set initdefault to this)● 1 - Single user mode● 2 - Multiuser, without NFS (The same as

3, if you do not have networking)● 3 - Full multiuser mode● 4 - unused● 5 - X11● 6 - reboot (Do NOT set initdefault to

this)

Page 5: Linux  入門課程 ( 基礎篇 )

Boot Procedure

● Boot Loader● Kernel● initrd (optional)● init● /etc/inittab

– /etc/rc.d/rc.sysinit– /etc/rc.d/rc3.d/* (3 is run level)– /etc/rc.local

● X Window● Display Manager or Desktop Manager

(run level 5)

Page 6: Linux  入門課程 ( 基礎篇 )

Keyboard Control

● Ctrl+Alt+F1~F6 Switch console● Ctrl+Alt+F7 X Window console● Tab Command line auto-

complete● ↑、↓ Edit history command● Shift+PgUp/PgDnScroll screen

Page 7: Linux  入門課程 ( 基礎篇 )

Mouse Control

● Mark 即複製● 中鍵貼上、或是同時按左右鍵

Page 8: Linux  入門課程 ( 基礎篇 )

File Structure (1)

● /bin binary,core utilities● /boot kernel 、 initrd● /dev device file● /etc config● /lib main library 、 glibc● /proc process file system● /sbin system binary● /tmp temp directory● /usr non-system

applications 、 library● /var log 、 spool 、 database

Page 9: Linux  入門課程 ( 基礎篇 )

File Structure (2)

● /home user home directory– /home/pank

● /mnt mounting directory● /root super user root directory

Others● /initrd initrd mounting directory● /opt some program install to /opt

Page 10: Linux  入門課程 ( 基礎篇 )

File System

● EXT2● EXT3 EXT2+ 日誌式系統● ReiserFS Hans Reiser 開發 ● XFS SGI 公司開發 ● JFS IBM 開發

Page 11: Linux  入門課程 ( 基礎篇 )

File Access Permissions

● Everyone 、 Group 、 Owner● Read 、 Write 、 eXecute● r=4 、 w=2 、 x=1● rwx=7● File Permission=777, Everyone can

read 、 write 、 execute– chmod 644 file– chmod 755 file– chmod 777 file

Page 12: Linux  入門課程 ( 基礎篇 )

Devices

● No C: D: E: …● Primary Master: /dev/hda● Primary Master 1st Partition: /dev/hda1● Mouse: /dev/psaux or /dev/mouse● Audio: /dev/dsp or /dev/audio● Mixer: /dev/mixer● Console: /dev/tty? (tty0 、 tty1…)● RAM Disk: /dev/ram0● Null: /dev/null

Page 13: Linux  入門課程 ( 基礎篇 )

Basic Commands (1)● cat 顯示檔案內容 =DOS/Windows 的 type● cd 轉移目錄 =DOS/Windows 的 cd● clear 清除螢幕 =DOS/Windows 的● cp 複製檔案 =DOS/Windows 的 copy● date 顯示日期、時間 =DOS/Windows 的 date● echo 印出字串 =DOS/Windows 的 echo● fdisk 分割磁碟 =DOS 的 fdisk● find 找尋檔案、目錄 =Windows 的搜尋功能● ftp 檔案傳送 =Windows 的 ftp● kill 終止程式之執行 =Windows 的 taskkill● ls 列出檔案資訊 =DOS/Windows 的 dir● mkdir 建立子目錄 =DOS/Windows 的 md/mkdir● rmdir 刪除子目錄 =DOS/Windows 的 rd/rmdir● mke2fs 製作檔案系統 =DOS/Windows 的 format● mv 更改、移動目錄或檔案 =DOS/Windows 的 move● netstat 查詢網路目前狀況 =Windows 的 netstat● ping 查詢網路上某主機是否開著 =Windows 的 ping● ps 查看系統中正在執行程序資料 =DOS/Windows 的 tasklist 或工

作管理員● rm 刪除檔案或目錄 =DOS/Windows 的 del● telnet 連到別台機器 =Windows 的 telnet

Page 14: Linux  入門課程 ( 基礎篇 )

Basic Commands (2)● chmod 改變檔案權限屬性● chown 更改檔案或目錄的擁有者● df 查詢硬碟使用量● du 查詢檔案的磁碟使用空間● fsck 檢查、修復 Linux 檔案系統● grep 用關鍵字找尋檔案● ln 建立符號連結 ( 捷徑 ) -s (soft link) ● man 查詢某個指令的說明● more 顯示檔案的內容 ( 暫停 )● mount 掛上檔案系統● passwd 改變密碼● pwd 顯示目前工作目錄路徑● su 切換使用者或 super user (root)● sync 把記憶體中的資料寫入硬碟● top 查看系統狀態● umount 卸下已掛上的檔案系統● uname 查詢 Linux 版本 ,uname -a● uptime 顯示目前的使用者和平均負荷● reboot 重新開機● shutdown 關機

Page 15: Linux  入門課程 ( 基礎篇 )

Shell Environment

● Default shell: bash - GNU Bourne-Again Shell

● stdin 、 stdout 、 stderr● < 、 > 、 |● Shell Script

Page 16: Linux  入門課程 ( 基礎篇 )

Basic Configuration

● /etc/fstab file system mounting table● /etc/group user group file● /etc/crontab 系統自動排程檔● /etc/hosts host names static table● /etc/resolv.conf DNS 設定檔● /etc/sysconfig/network-scripts/ifcfg-eth0

IP/NETMASK● /etc/sysconfig/network

HOSTNAME 、 GATEWAY● /etc/bashrc bash 設定檔● /etc/inittab init table● /etc/sysctl.conf kernel parameters

Page 17: Linux  入門課程 ( 基礎篇 )

Services

● Service 管理工具 ( 一般 ): chkconfig● 其他管理工具 : ntsysv 、 drakxservices● Service scripts in /etc/init.d/*● xinetd services configuration /etc/xinetd.d/*● 常用 Services:

– apache– crond– imap– ipop3– keytable– network– smb– sshd– syslog– xinetd

Page 18: Linux  入門課程 ( 基礎篇 )

Information

● dmesg Kernel 開機過程● /var/log/messages 系統資訊● /var/log/syslog 系統記錄● /proc/cpuinfo CPU 資訊● /proc/meminfo 記憶體資訊● /proc/modules 載入的 modules 資

訊● /proc/pci PCI 資訊● /proc/version Kernel 版本資訊

Page 19: Linux  入門課程 ( 基礎篇 )

Archives

● 壓縮 gzip file● 解壓縮 gunzip file.gz● 包裝 tar cf files.tar file1 file2 fileN● 解包裝 tar xf files.tar● 壓縮 tar czf files.tar.gz file1 file2 fileN● 解壓縮 tar zxf files.tar.gz● 壓縮 tar cjf file.bz2 file1 file2 fileN● 解壓縮 tar jxf file.bz2

Page 20: Linux  入門課程 ( 基礎篇 )

User and Group Management

● useradd 新增使用者● userdel 刪除使用者● usermod 異動使用者資料● groupadd 新增群組● groupdel 刪除群組● groupmod 異動群組資料● passwd 設定使用者密碼

Page 21: Linux  入門課程 ( 基礎篇 )

Applications

● Web browser Firefox 、 Mozilla● Email client Thunderbird 、 Evolution● Office OpenOffice● Editor vi 、 joe 、 gedit● Files downloading wget 、 ncftp 、 Gftp● IM Gaim● PDF Viewer Acrobat Reader 、 Xpdf● Audio Player Xmms● Movie Player Mplayer● Graphic Gimp● Picture Viewer xv 、 xnview 、 qiv● CD/DVD burner k3b 、 cdrdao 、 LinuxNero● Dictionary StarDict 、 pydict● Terminal rxvt 、 Gnome TerminalThe table of equivalents / replacements / analogs of Windows software in Linux. http://www.linuxrsp.ru/win-lin-soft/table-eng.html

Page 22: Linux  入門課程 ( 基礎篇 )

THE END

謝謝大家