ดาวน์โหลดงานนำเสนอ
งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ
ได้พิมพ์โดยประสาน พิศาลบุตร ได้เปลี่ยน 8 ปีที่แล้ว
1
Linux Operating System Chavalit Srisathapornphat NETE0516 November 27, 2007
2
October 27, 2007NETE0516: Operating Systems 2 Outline ● What is Linux? ● Windows Compability Issue ● Benefits, History, Distributions & Licensing ● Ubuntu ● Installation Steps ● Linux Commands ● vim Text Editor
3
October 27, 2007NETE0516: Operating Systems 3 What is Linux? ● Two ways of looking at a PC – Black box as other users – Collection of components as PC builders ● OS is just another component of a computer system – It has been monopolized by the big name OS – Actually, you can choose your own favorite OS! ● Linux (GNU/Linux) – Full-fledged operating system – Small appliances – PDA – PC – Mini – Parallel/Supercomputer – Linux Torvalds (Finnish) as an undergraduate student in 1991
4
October 27, 2007NETE0516: Operating Systems 4 Windows Compatibility Issue ● Linux is COMPLETELY different from Windows – Based on UNIX – industrial strength OS (1970) – Windows applications are not able to run on it ● How to run Windows applications on Linux – Wine – http://www.winehq.com – Virtual machines – VMWare – Linux equivalent versions
5
October 27, 2007NETE0516: Operating Systems 5 Benefits of Linux ● Crash-Free – UNIX is very stable. Not 100% true for Linux ● Linux programmers use different methods of bug testing ● But bugs are discovered and fixed very quickly ● Security – Files/directories permission and less security holes ● Free and shareable ● Compatible with older hardware – Requires less resources
6
October 27, 2007NETE0516: Operating Systems 6 History of Linux ● Linux is a modern, free operating system based on UNIX standards ● First developed as a small but self-contained kernel in 1991 by Linus Torvalds, with the major design goal of UNIX compatibility ● Its history has been one of collaboration by many users from all around the world, corresponding almost exclusively over the Internet ● It has been designed to run efficiently and reliably on common PC hardware, but also runs on a variety of other platforms ● The core Linux operating system kernel is entirely original, but it can run much existing free UNIX software, resulting in an entire UNIX-compatible operating system free from proprietary code ● Many, varying Linux Distributions including the kernel, applications, and management tools ● http://www.levenez.com/unix/
7
October 27, 2007NETE0516: Operating Systems 7 Linux Distributions ● Standard, precompiled sets of packages, or distributions, include the basic Linux system, system installation and management utilities, and ready-to-install packages of common UNIX tools ● The first distributions managed these packages by simply providing a means of unpacking all the files into the appropriate places; modern distributions include advanced package management ● Early distributions included SLS and Slackware – Red Hat and Debian are popular distributions from commercial and noncommercial sources, respectively ● The RPM Package file format permits compatibility among the various Linux distributions
8
October 27, 2007NETE0516: Operating Systems 8 Linux Licensing ● The Linux kernel is distributed under the GNU General Public License (GPL), the terms of which are set out by the Free Software Foundation ● Anyone using Linux, or creating their own derivative of Linux, may not make the derived product proprietary; software released under the GPL may not be redistributed as a binary-only product
9
October 27, 2007NETE0516: Operating Systems 9 Ubuntu Linux ● Ubuntu – Based on Debian distribution – Its goal is to give anyone in the world access to an easy-to-use version of Linux – No commercial version of Ubuntu – Ubuntu = "humanity to others” – Ubuntu is geared toward desktop users
10
October 27, 2007NETE0516: Operating Systems 10
11
October 27, 2007NETE0516: Operating Systems 11 Pre-Installation Steps ● Making decision about multiple OS ● Understanding Partitioning ● Freeing Up Space ● Backing Up Data – Backing up e-mail files – Make note of all important numbers ● Repartitioning ● Get Ubuntu on a CD
12
October 27, 2007NETE0516: Operating Systems 12 Making Decision about Multiple OS ● ทางเลือกในการ install Ubuntu – ติดตั้งเป็น OS เดียวในเครื่อง PC – ติดตั้งแบบ dual boot ร่วมกับ Windows ● ติดตั้ง Windows อยู่แล้ว ● เครื่องใหม่ – ติดตั้ง Windows ก่อน – ติดตั้ง Ubuntu ก่อน – ติดตั้งใน Virtual machine เช่น VMware
13
October 27, 2007NETE0516: Operating Systems 13 Understanding Partitioning
14
October 27, 2007NETE0516: Operating Systems 14 Repartitioning ● Two options – Under Windows ● ใช้ tools เช่น Partition Magic (non-free) – While installing Ubuntu ● Ubuntu มีความสามารถที่จะลดขนาด partition ของ Windows ลงได้ แล้วจัดการสร้าง partition ให้กับ Ubuntu โดยไม่มีผลกระทบกับ partition ของ Windows ● ต้องมี disk space เหลืออยู่เพียงพอ ● Other options – Install Ubuntu ลงใน harddisk ใหม่เลย ● Recommendation – at least: root partition, home partition, swap partition
15
October 27, 2007NETE0516: Operating Systems 15 Installation ● Boot from the CD ● เลือก Start or Install จาก boot menu แล้วรอ จนกระทั่งแสดง Desktop ● click ที่ icon Install (ในขณะนี้สามารถใช้งาน Ubuntu ได้จาก CD) ● เลือกภาษาที่จะใช้ในการ install – มีภาษาไทย ด้วย ! ● เลือก keyboard layout และ locale ● เลือก timezone ● ตัดสินใจเลือก partition ที่จะ install – Root > 3GB, Swap ประมาณ 1.5 เท่าของ memory, Home – ตามใจชอบ ● ใส่ชื่อและข้อมูลของ user - แล้วเริ่มลงมือ install รอ..รอ..รอ...
16
October 27, 2007NETE0516: Operating Systems 16 First Boot ● สิ่งที่ต้องทำหลังจาก Install เสร็จแล้วคือ – เลือก Restart – นำ CD ออกจาก drive แล้วกด ปุ่ม Enter ให้เครื่องทำการ restart – เมื่อ boot ขึ้นมาใหม่ จะแสดง Boot menu ของ Grub (Boot manager) ● Default จะเป็นการบูตเข้าสู่ Ubuntu – สามารถเลือก ให้บูต Windows ได้ ● เมื่อบูตเข้าสู่ Ubuntu เสร็จ สิ่งที่ต้องหรือควรทำ คือ – การ update software ที่มีการปรับปรุงใหม่ ซึ่ง สามารถทำได้จาก online source ของ Ubuntu โดยการเปิด Terminal แล้วใช้คำสั่งต่อไปนี้ที่ command prompt ● sudo apt-get update ● sudo apt-get upgrade – User ที่เรากำหนดไว้ตอน install จะถือเป็น admin ของเครื่อง ● sudo ทำการรันคำสั่งของ Linux โดยทำหน้าที่เป็น root หรือ admin ชั่วคราว
17
October 27, 2007NETE0516: Operating Systems 17 After First Boot ● สิ่งที่ต้องทำต่อเนื่องคือ – การปรับให้เครื่องทำการตั้งเวลาอัตโนมัติโดยใช้ Network Time Protocol ● Right click ที่นาฬิกา ในแถบ panel ด้านบน แล้วเลือก Adjust date and time ● อาจต้องใส่ password ● ปรับ Timezone ถ้าไม่ถูกต้อง ● ในช่อง Configuration เลือกให้เป็น Keep synchronize with Internet servers ● แล้ว click ปุ่ม Install NTP จากนั้นทำตาม instruction ● Install font ภาษาไทย เพิ่มเติม – sudo apt-get install msttcorefonts – อาจ copy fonts ที่ต้องการใช้มาจาก Windows ไว้ ใน /usr/share/font/WindowsFonts แล้วรัน sudo fc-cache -f -v
18
October 27, 2007NETE0516: Operating Systems 18 Linux Commands ● Command syntax – $ verb [options] [arguments]
19
October 27, 2007NETE0516: Operating Systems 19 Common Commands ● date – ● cal – ● who – ● whoami – ● passwd – ● echo – ● man – – $ -- help
20
October 27, 2007NETE0516: Operating Systems 20 Common Commands ● tty ● clear ● stty – stty -a, stty sane, stty erase ^h, stty eof ^d, stty kill ^u, stty intr ^c ● script – script -a ● uname – uname -a ● bc – scale, ibase, obase – http://www.gnu.org/software/bc/manual/bc.html
21
October 27, 2007NETE0516: Operating Systems 21 vim Text Editor – Outline ● Editor Concepts ● The vi Editor ● Modes ● Commands – Add – Cursor move – Scroll – Delete – Join – Undo – Save and exit ● vim
22
October 27, 2007NETE0516: Operating Systems 22 Editor Concepts ● Editor – editing ● creating a new file & modifying an existing one – editor ● a utility that facilitates the editing task ● aka. text editor – text editor <> word processor ● no formatting ● used to create and edit text quickly and efficiently – Types ● Line editors ● Screen editors
23
October 27, 2007NETE0516: Operating Systems 23 Line Editors ● Examples – sed and ex in UNIX ● Usage – make changes to a line or a group of lines – to edit a line ● select those lines first ● specify changes ● Limitation – difficult to use than a screen editor – need to know how to select the group of lines
24
October 27, 2007NETE0516: Operating Systems 24 Screen (Text) Editors ● Examples – vi, vim and emacs ● You're somewhat familiar with this type – word processor without WYSIWYG feature ● vi – (visual editor) – basic editor comes with minimal Linux installation ● vim – (vi-improved) – a lot better vi-like editor ● emacs – ( http://www.acronymfinder.com/af-query.asp?acronym=EMACS ) – an extensible editor with modes for programming, writing and the creation of simple drawings
25
October 27, 2007NETE0516: Operating Systems 25 The vi Editor http://www.thinkgeek.com/homeoffice/mugs/7BBE/
26
October 27, 2007NETE0516: Operating Systems 26 Modes ● two basic modes in vi – Command mode ● any key pressed is considered a command ● no return key after each command ● most commands are not echoed ● except those started with colon (:), slash (/), and ? – Text mode ● any key pressed is considered a text input – If you want to type ● in the command mode – move cursor to the correct location ● switch to the text mode and start typing
27
October 27, 2007NETE0516: Operating Systems 27 Changing Modes
28
October 27, 2007NETE0516: Operating Systems 28 Add Commands
29
October 27, 2007NETE0516: Operating Systems 29 Insert
30
October 27, 2007NETE0516: Operating Systems 30 Insert
31
October 27, 2007NETE0516: Operating Systems 31 Cursor Move Commands
32
October 27, 2007NETE0516: Operating Systems 32 Cursor Move Commands
33
October 27, 2007NETE0516: Operating Systems 33 Delete Commands
34
October 27, 2007NETE0516: Operating Systems 34 Scroll Commands
35
October 27, 2007NETE0516: Operating Systems 35 Undo and Exit Commands
36
October 27, 2007NETE0516: Operating Systems 36 vim ● Outline – File manipulation – Advanced cursor moving – Changing text – Searching – Selecting text and cut & paste – Multiple windows –.vimrc – vim startup configuration file
37
October 27, 2007NETE0516: Operating Systems 37 File Manipulation ● Read-only opening a file – view ● File locking – vim locks the file you are editing – A warning message is display when you're trying to open a file that is locked ● The file that you were editing when vim crashed ● Saving into a new file – :sav ● Recovering a crashed file – vim -r
38
October 27, 2007NETE0516: Operating Systems 38 Advance Cursor Moving ● Moving cursor by sentences – ( and ) ● Moving cursor by paragraphs – { and } ● Moving the the top/mid/bottom of the screen – H M L
39
October 27, 2007NETE0516: Operating Systems 39 Changing Text ● Replacing text ● r – replace one character, then go back to command mode ● R – replace all characters until 'return' is placed ● Changing text ● c – change one character, until 'return' ● cc – change the current line ● C – change to the end of line – c ● cw – change one word, until 'return' ● c3w ● c$ ● 5cc
40
October 27, 2007NETE0516: Operating Systems 40 Searching ● Searching forward – \ - find 'string' in the following text – ? - find 'string' in the previous text – :set incsearch – incremental search – :set ic – ignore case – :set hls – highlight search ● n - next matched string ● N – previous matched string
41
October 27, 2007NETE0516: Operating Systems 41 Selecting Text and Cut and Paste ● Selecting text – v – start selecting text, follows by a command – V – start selecting a line – Ctrl-v – block selection ● Cut & paste – Selecting text – y – yank – similar to 'd' but copy the selected text into buffer – move to a new place – p/P – put ● p – insert after the current character ● P – insert before the current character
42
October 27, 2007NETE0516: Operating Systems 42 Multiple Windows ● Split to multiple windows – Ctrl-ws, Ctrl-wv, Ctrl-wn, :sp ● Switch between windows – Ctrl-ww – Ctrl-w[hjkl] ● Resize windows – Ctrl-w= – Ctrl-w[+-] ● Help – :help windows
43
October 27, 2007NETE0516: Operating Systems 43.vimrc ● Startup file -.vimrc – Parameters set inside this file will be read when vim starts set expandtab set tabstop=3 set column=80 set textwidth=72 set wrapmargin=3 set ignorecase set hls set nobackup set list noremap V v noremap v V ● More info – http://www.vim.org
งานนำเสนอที่คล้ายกัน
© 2024 SlidePlayer.in.th Inc.
All rights reserved.