0% found this document useful (0 votes)
6 views

00-2021-09-02-Linux

Uploaded by

taybulislam33
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

00-2021-09-02-Linux

Uploaded by

taybulislam33
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Linux Operating

System Principle and


its Application
Xiaoliang Meng
[email protected]
[email protected]
孟晓亮 , Office: 9-418
Teaching Arrangements

 Total Hours: 48
 Lecture: 40 hours
 Experiment: 8 hours
Experiment

 (1) The 4th week, Wednesday.


 (2) The 8th week, Wednesday.
 (3) The 12th week, Wednesday.
 (4) The 17th week, Wednesday.
Final Grade

 Attendance: 10%
 Experiment: 20%
 Final exam: 70%
Roadmap

 What is Unix?
 What is Linux?
 Which Linux Distribution is better?
 Basic Commands
 Vi and Emacs
What is Unix?

 A multi-task and multi-user Operating System


 Developed in 1969 at AT&T’s Bell Labs by
 Ken Thompson (Unix)
 Dennis Ritchie (C)
 Douglas Mcllroy (Pipes - Do one thing, do it well)
 Some other variants: System V, Solaris, SCO
Unix, SunOS, 4.4BSD, FreeBSD, NetBSD,
OpenBSD, BSDI
What is Linux?
 A clone of Unix
 Developed in 1991 by Linus Torvalds, a Finnish
graduate student
 Inspired by and replacement of Minix
 Linus' Minix became Linux
 Consist of
 Linux Kernel
 GNU (GNU is Not Unix) Software
 Software Package management
 Others

http://www.cs.ucr.edu/~weesan/
cs183/ http://www.linuxdevices.com/files/misc/ibm-watchpad.jpg
What is Linux?
 Originally developed for
32-bit x86-based PC
 Ported to other
architectures, eg.
 Alpha, VAX, PowerPC,
IBM S/390, MIPS, IA-64
 PS2, TiVo, cellphones,
watches, Nokia N810,
NDS, routers, NAS, GPS,

* See references at the end


for the corresponding websites.
Which Linux Distribution is
better?
 > 300 Linux Distributions
 Slackware (one of the oldest, simple and stable distro.)
 Redhat
 RHEL (commercially support)
 Fedora (free)
 CentOS (free RHEL, based in England)
 SuSe ( based in German)
 Gentoo (Source code based)
 Debian (one of the few called GNU/Linux)
 Ubuntu (based in South Africa)
 Knoppix (first LiveCD distro.)
 …
Which Linux Distribution is
better? Ubuntu
Debian
Knoppix

Slackware Gentoo

CentOS

Redhat

Source: http://www.cs.ucr.edu/~weesan/
cs183/
http://futurist.se/gldt/
Which Linux Distribution is
better?
 Ask yourself these questions
 Is it going to be around in 5 yrs?
 Is it giong to stay on top of the latest security
patches?
 Is it going to release updated software promptly?
 If I have problems, will the vendor talk to me?
 We will use Ubuntu
Basic Commands
 ls  which
 $ ls -l  $ which ls
 $ ls -a  whereis
 $ ls -la  $ whereis ls
 $ ls -l --sort=time  locate
 $ ls -l --sort=size -r  $ locate stdio.h
 cd  $ locate iostream
 $ cd /usr/bin  rpm
 pwd  $ rpm -q bash
 $ pwd  $ rpm -qa
 ~  $ rpm -qa | sort | less
 $ cd ~  find
 ~user  $ find / | grep stdio.h
 $ cd ~weesan  $ find /usr/include | grep stdio.h
 What will “cd ~/weesan” do?
Basic Commands (cont)
 echo  rm
 $ echo “Hello World”  $ rm foo
 $ echo -n “Hello World”  $ rm -rf foo
 cat  $ rm -i foo
 $ cat /etc/motd  $ rm -- -foo
 $ cat /proc/cpuinfo  chgrp
 cp  $ chgrp bar /home/foo
 $ cp foo bar  chsh
 $ cp -a foo bar  $ chsh foo
 mv
 chfn
 $ mv foo bar
 $ chfn foo
 mkdir
 chown
 $ chown -R foo:bar /home/foo
 $ mkdir foo
Basic Commands (cont)
 tar  Pipe
 $ tar cvfp lab1.tar lab1  $ cal > foo
 gzip  $ cat /dev/zero > foo
 $ gzip -9 lab1.tar  $ cat < /etc/passwd
 untar & ungzip  $ who | cut -d’ ‘ -f1 | sort |
 $ gzip -cd lab1.tar.gz | tar xvf – uniq | wc –l
 $ tar xvfz lab1.tar.gz  backtick
 touch  $ echo “The date is `date`”
 $ touch foo  $ echo `seq 1 10`
 $ cat /dev/null > foo  Hard, soft (symbolic) link
 ln vmlinuz-2.6.24.4 vmlinuz
 ln -s firefox-2.0.0.3 firefox
Basic Commands (cont)
 Disk usage
 $ df -h /
 Advance stuff 
 $ ssh eon who
 $ ssh eon ‘cd .html ; tar cvfp - cs183 | gzip -9c’ | tar
xvfpz -
 $ ssh kilo-1 ‘tar cvfp - /extra/weesan’ | tar xvfp - -C /
Vi
 2 modes  Delete
 Input mode
 dd (delete a line)
 d10d (delete 10 lines)
 ESC to back to cmd mode  d$ (delete till end of line)
 Command mode  dG (delete till end of file)
 Cursor movement
 x (current char.)
 h (left), j (down), k (up), l (right)
 Paste
 ^f (page down)
 p (paste after)
 ^b (page up)
 P (paste before)
 ^ (first char.)  Undo
 $ (last char.)  u
 G (bottom page)  Search
 :1 (goto first line)  /
 Swtch to input mode  Save/Quit
 a (append)  :w (write)
 i (insert)  :q (quit)
 o (insert line after  :wq (write and quit)
 O (insert line before)  :q! (give up changes)
Book

You might also like