• 沒有找到結果。

Introduction to Unix-like System

N/A
N/A
Protected

Academic year: 2022

Share "Introduction to Unix-like System"

Copied!
21
0
0

加載中.... (立即查看全文)

全文

(1)

Introduction to Unix-like System

Macaca Li

National Taiwan University

2014/02/24

(2)

Who am I

B97902018/R01922001 Experience:

NASA TA (101-1, 101-2) DSA TA (100-2)

Machine Learning TA (100-1, 102-1) Poor at: Systems and Architectures How to learn UNIX?

Experience Google

(3)

What is 217 Workstation Lab

http://wslab.csie.ntu.edu.tw/

(4)

How many OS you know

(5)

What is UNIX

Compliant with and certified according to the Single UNIX Specification

First developed in 1969, including Ken Thompson

Dennis Ritchie Brian Kernighan Douglas McIlroy Michael Lesk Joe Ossanna

Multitasking and multi-user OS Unix-like System

(6)

Dennis Ritchie

All computer science students should know him

(7)

Unix-like

BSDs Linux Mac OS Solaris Minix SunOS

(8)

Linux-Kernel

Accessing hardwares

Provides the functions you would learn from OS-related courses Can shed the parts you don’t need - Android

(9)

Distributions

Built on the kernel with many applications

Ubuntu, Debian, Fedora, CentOS, Redhat, SUSE, ... etc

(a) Ubuntu (b) Debian

(c) Fedora (d) SUSE

(10)

Why use UNIX

Stability Performance Security Price

”Given enough eyeballs, all bugs are shallow.” - Linus Question

Is UNIX a panacea ?

(11)

Logging to 217 workstation

All in http://wslab.csie.ntu.edu.tw/ssh/

(12)

Path

. ..

Absolute path

(13)

Basic Commands

File cd ls mkdir rm mv cp find pwd

Man

Manual rather than guys ex: man ls man man (-k)

Text cat more less tail head grep diff sort wc cut -d -f vim

Others whoami who ps aux top kill alias tar awk sed

(14)

Vim

Insert: i

Command: Esc Save: :w Exit: :q vimtutor

(15)

Redirect the input and output

<

>

>>

Demos

(16)

Combos - Pipe

Combine multiple commands with I/O redirection Example - list /bin

ls -al /bin | more

Exercise

How to find the arguments for recursive copying?

How many processes are running How many users are logging Ans: who | cut -d -f1 | uniq | wc -l Who are logging in ascending order

(17)

File Permissions

What is this

(18)

File Permissions I

r: read w: write x: execute

rwx rwx rwx (User Group Others)

(19)

File Permissions II

Regualr File Permissions r: read

w: write x: execute

Directory Permissions r: read (ls)

w: write (cp, mv, ...) x: execute (cd)

(20)

Shell Script

Combine more commands with more flexibilities Scenerio1

You need to do a sequence of commands such as mkdir test1

touch ./test1/doc1 touch ./test1/doc2 mkdir test2

touch ./test1/doc3 for 10 times ...

Scenerio2

(21)

Basic Structure

Learning by Examples

參考文獻

相關文件

A trait implementation class which contains the definitions for the provided methods of the trait, proxy fields for the user of the trait and all used traits, as well as

command tells Vim to run the text through a UNIX command.The ‘a tells the editor that the text to be worked on starts at the current line and ends at mark a.. The command that

• Make sure your terminal handles 中文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

• Make sure your terminal handles 中⽂文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

• Make sure your terminal handles 中⽂文 well
 keyword: encoding, UTF-8, or Big5.. • Choose a

有關 PHP 的敘述何者有誤?①可在 Apache、MS IIS 等 Web 伺服 器執行的 Script②只能在 Linux 或 Unix 作業系統上執行,無法於 Windows 或 Mac

Young people like to play computer

Recycling Techniques are Available to Address Specific Pavement Distress and/or Pavement Structural Requirement.. Introduction to Asphalt Introduction