Presentation is loading. Please wait.

Presentation is loading. Please wait.

TUTORIAL LESSON Linux & Tools

Similar presentations


Presentation on theme: "TUTORIAL LESSON Linux & Tools"— Presentation transcript:

1 TUTORIAL LESSON Linux & Tools
Parallel Processing Institute(PPI) FuDan University 2017.9

2 BIRTH of TUTORIAL LESSON
ICS introduces the Computer Systems, then WHO introduces ICS ? A new environment: Linux Many new tools: svn, … ICS Book does not contain them Parallel Processing Institute(PPI)

3 OUTLINE Pre-requisite Linux Tools

4 Pre-requisite Linux Tools

5 HARD RULES Deadline: No Extension Plagiarism: No Tolerance
Multiple submissions Plagiarism: No Tolerance Forbid C&P from Network from Classmates Punishment 0 point for ALL Parallel Processing Institute(PPI)

6 Cheating will not be tolerated
All homework, labs and exams are to be done individually. It is your responsibility to ensure that your passwords are well-guarded, directories protected, and printouts do not fall into other hands. Parallel Processing Institute(PPI)

7 WARNING … 不过我的本意并没有提供代码让他抄袭的啊。他有一个binfile 的函数怎么调试都不对,我确实把这段代码发给了他,但我教会了他怎么做的了。… …, 她请教我怎么优化,我跟她讲了优化方法然后她自己去改了,改过以后问我为什么效率没有提升, 我就叫她让我看下她的代码,发现没有实质性的优化,我嫌讲不清就叫她参考我的代码, … … 我们都是“好学生”,在同学之间会很难拒绝。这次之后就没有这种情况发生了。… …, 知道了,只是实在不会写唉,没学c这个指针真的看不太懂额。这次错了,下次一定不会这么做了。不过能不能请老师不要把 XX判为0分 … … XXX没有错,有错的是将他的代码直接交上去的人,他们根本就没考虑一下这可能对XXX造成什么影响。… Parallel Processing Institute(PPI)

8 Pre-requisite Linux Tools
Introduction Installation Shell Pre-requisite Linux Tools

9 BACKGROUND The History of Linux Linus Torvalds, 1991
Unix-like Operating Systems “ Unix is not so much an operating system as an oral history ” Heirs: Linux, BSD, Solaris, MacOS X, … Linux是在Unix的基础上,Linus把底层的实现都给换掉了,所以和Unix比较接近。Unix的继承者比如,Linux,BSD是伯克利大学开发的,Solaris是太阳公司开发的,不过太阳公司已经被甲骨文收购了。还有Apple的macOS是基于Unix的。 Parallel Processing Institute(PPI)

10

11 Pre-requisite Linux Tools
Introduction Installation Shell Pre-requisite Linux Tools

12 INSTALL Step 0: How to find it ?
Tips: about version Ubuntu Ubuntu 16.04 Debian Jessie(8.0) INSTALL Step 0: How to find it ? Online: get the official web-site by google Debian (/'dɛbiːjən/, Debra + Ian) Ubuntu(/ʊˈbʊntuː/,uu-buun-too) Parallel Processing Institute(PPI)

13 INSTALL Step 1: Where to install it ? Cygwin on RAW machine
Tips: virtual machine Definition provides a complete system platform which supports the execution of a complete operating system Java Runtime Environment INSTALL Step 1: Where to install it ? Cygwin Sorry, no technical support on RAW machine Cool ! on VIRTUAL machine Safety! Dangerous ! Recommendation ! Parallel Processing Institute(PPI)

14 INSTALL Step 2: Create VM Select a Guest Operating System (if no ISO)
Tips: VMware Workstation Benefit hosted, popular, graphic easy, stable, checkpointed INSTALL Step 2: Create VM Select a Guest Operating System (if no ISO) e.g. Ubuntu 16.04 Set name and location Disk capacity 20G (engross on demand) Network connection (customized) Bridge (separate IP) or NAT (internal IP, default) Done ! Parallel Processing Institute(PPI)

15 INSTALL Step 3: Configure VM Let’s go ! Insert ISO image
“VM -> Settings -> CD-ROM : Use ISO Image” ISO Image: “Ubuntu amd64-CD-1.iso” Configure Hardware (Customized) Memory Size #CPU / #Core Ethnet Mode Power On Let’s go ! Parallel Processing Institute(PPI)

16 APPENDIX: System Virtualization
Architecture VM VM Unmodified User Software Unmodified User Software VM VM Unmodified User Software Unmodified User Software Operating System Operating System Operating System Operating System Virtual Machine Monitor Host Operating System Virtual Machine Monitor Hardware (CPU, Memory, Disk, Ethernet) Hardware (CPU, Memory, Disk, Ethernet) Non-hosted Hosted Parallel Processing Institute(PPI)

17 APPENDIX: System Virtualization
Virtual Machine Monitor VMware (EMC) Player, Workstation, … Fusion, VMware Server, ESX Server, … Other s Hyper-V (Virtual PC) xVM (VirtualBox) KVM, Xen 部分同学的BIOS没有打开CPU的虚拟化。 Parallel Processing Institute(PPI)

18 Pre-requisite Linux Tools
Introduction Installation Shell Pre-requisite Linux Tools Institute of Parallel and Distributed System (iPads), SJTU

19 SHELL Operating System Shell
Provide access to the services of a kernel Command-Line Interface (CLI) Unix Shell e.g. Bounce-Again Shell, bash Non-Unix Shell e.g. DOS Graphical User Interface (GUI) Windows, X Window (KDE, GNOME, Xfce), Mac OS Parallel Processing Institute(PPI)

20

21 Commands MOST IMPORTANT Search Path: /bin, /usr/bin, ...
Command is case sensitive man – display the on-line manual pages e.g. >man man whatis – search the whatis database for complete words e.g. >whatis passwd Parallel Processing Institute(PPI)

22 Commands File and Directory ls - list files/dirs e.g. >ls -l
mkdir – create a dir e.g. >mkdir test cd - change dir e.g. >cd test rm - remove files/dirs e.g. >rm -f a.txt cp - copy files/dirs e.g. >cp a.txt b.txt mv – move files/dir s e.g. >mv a.txt c.txt pwd – show current path e.g. >pwd du – estimate files/dirs space usage e.g. >du -c -h test df – report free disk space e.g. >df Parallel Processing Institute(PPI)

23 Commands File and Directory
chmod – change mode of file/dir e.g. >chmod 777 test chown – change owner of file/dir e.g. >chown rong edit chgrp – change group of file/dir e.g. >chgrp guest draft -R $ ls -l drwxr--r-- 1 peter admin Mar drafts -rw-r--r-- 1 peter admin Mar edition-32 -r-xr-xr-x 1 terry admin Mar edit duuugggooo C owner group size date name C:(hard link count) Parallel Processing Institute(PPI)

24 Commands Search whereis - locate special files for a command (binary, src and manual file) e.g. >whereis cp find – search for files/dirs in a dir hierarchy e.g. >find . –name “c.txt” locate – locate files/dirs by name in system based on a database e.g. >locate test grep – text search utility e.g. >grep “abc” . -R Grep 可以用来搜索当前目录包含所有文件所拥有的字符 Parallel Processing Institute(PPI)

25 Commands User Account useradd – create a new user e.g. >useradd rong userdel – delete a user account e.g. >userdel rong passwd – set password for a user account based on a database e.g. >passwd rong users – print name of user currently logged e.g. >users Parallel Processing Institute(PPI)

26 Commands Text cat – concatenate and print files e.g. >cat b.txt
head – output the first part of files e.g. >head –n 4 b.txt tail – output the last part of files e.g. >tail –c 50 b.txt wc – print the number of newlines, words, and bytes in files e.g. >wc b.txt cut – remove sections from each line of files e.g. >cut –c 4-10 b.txt Wc可以用来统计一个文本的行数,字符数和所占用的字节数 Cut 移除文本的每一行的一段 Parallel Processing Institute(PPI)

27 Commands Misc echo – display a line of text e.g. >echo $PATH
mount – mount a file system e.g. >mount /dev/sda3 /mnt umount – unmount a file system e.g. >umount /mnt ping – send ICMP ECHO_REQUEST to network hosts e.g. >ping date – print or set the system date and time e.g. >date "+%m/%d/%y“ time – time a simple command e.g. >time locate mapreduce Time 使用用过计时器,它输出结果包含三个,一个是实际墙上时间,一个是用户态时间,一个是系统时间。在单线程程序时候,一般这个程序的real 会是用户态+系统时间 但是多线程是不一样的,用户态时间会通过多个核上运行的时间这样就可能会出现用户态时间比其他两个时间都要多的多的。 Parallel Processing Institute(PPI)

28 Pre-requisite Linux Tools
Software Installer Compressing and Archiving Remote Login Text Editor

29 VERSION CONTROL APT (Advanced Package Tools)
A management system for software packages Package resource list for APT: /etc/apt/sources.list $ cat /etc/apt/source.list ... deb squeeze main dbe-src squeeze main type URI of source dist comp URI type: http, ftp, cdrom, file, ssh ... 文件的类型,是deb类型的。有些情况下,没办法通过apt-get安装软件,把下载好的deb包,然后使用dpkg工具进行安装。像Linux要想连接到外网,你首先的登录校园网,要登录校园网,就要使用curl工具,Linux要想通过apt-get安装curl工具又得连接到外网。这个时候就可以 Parallel Processing Institute(PPI)

30 VERSION CONTROL APT (Advanced Package Tools)
apt-get: command-line tool update e.g. >apt-get update install e.g. >apt-get install htop remove e.g. >apt-get remove htop upgrade e.g. >apt-get upgrade htop Parallel Processing Institute(PPI)

31 Pre-requisite Linux Tools Software Installer Compressing and Archiving
Remote Login Text Editor

32 COMPRESSING GZIP (Gnu ZIP) gzip file format Compress just single file
Replace the original file with .gz file e.g. >gzip test.txt >gunzip test.txt.gz Linux中广泛的压缩文件,用于对一个文件进行压缩和解压缩。并且压缩出来的文件会替换掉原始的文件。 Parallel Processing Institute(PPI)

33 ARCHIVING TAR (Tape ARchive) tar file format Suffix:
.tar e.g. >tar -cf src.tar src/ .tgz/.tar.gz e.g. >tar -zxf src.tar.gz .tbz/.tar.bz2 e.g. >tar -jcf src.tbz src/ Tape 磁带 Parallel Processing Institute(PPI)

34 Pre-requisite Linux Tools Software Installer Compressing and Archiving
Remote Login Text Editor

35 REMOTE LOGIN SSH (Secure SHell) A Replacement for Telnet
Communication through a secure channel Tatu Ylönen, 1995 OpenSSH (OpenBSD Secure Shell), 1999 e.g. >ssh SCP, A Replacement for FTP e.g. >scp b.txt >scp ./ Parallel Processing Institute(PPI)

36 Pre-requisite Linux Tools Software Installer Compressing and Archiving
Remote Login Text Editor

37 TEXT EDITOR vi (Visual Editor) /'viː'ai/, not /'siks/ 
Extension: vim, vile, xvi, … Simple and Convenient BOOK: “learning the vi editor” Cheat Sheet (Chinese version) “>vimtutor” to get a simple tutorial Parallel Processing Institute(PPI)

38 TEXT EDITOR Emacs (Editing MACroS) /'imæks/ More powerful than IDE !
Emacs List BOOK: “Learning GNU Emacs” Parallel Processing Institute(PPI)

39 TEXT EDITOR gedit Small text editor in the gnome desktop environment
Parallel Processing Institute, Fudan University

40 Thanks


Download ppt "TUTORIAL LESSON Linux & Tools"

Similar presentations


Ads by Google