Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Linux shishu 2005-3-5 Microprocessor Research Center of Peking University Software Research Group © 2004 Microprocessor Research Center.

Similar presentations


Presentation on theme: "Introduction to Linux shishu 2005-3-5 Microprocessor Research Center of Peking University Software Research Group © 2004 Microprocessor Research Center."— Presentation transcript:

1 Introduction to Linux shishu 2005-3-5 Microprocessor Research Center of Peking University Software Research Group © 2004 Microprocessor Research Center of Peking University – All Rights Reserved

2 A fully-networked 32/64-Bit Unix-like Operating System –Unix Tools Like sed, awk, and grep (explained later) –Compilers Like C, C++, Fortran, Smalltalk, Ada –Network Tools Like telnet, ftp, ping, traceroute Multi-user, Multitasking, Multiprocessor Has the X Windows GUI Coexists with other Operating Systems Runs on multiple platforms Open Source What is Linux

3 Tips No. 1 Step by Step

4 /Start point of file system, root directory/Start point of file system, root directory /homeUsers’ directory/homeUsers’ directory /bin Standard commands and tools/bin Standard commands and tools /usr Users’ files/usr Users’ files /usr/binUsers’ commands and applications/usr/binUsers’ commands and applications /usr/sbinAdministrator’s applications/usr/sbinAdministrator’s applications /usr/libProgramming libraries/usr/libProgramming libraries /usr/docLinux documents/usr/docLinux documents /usr/manOnline manual/usr/manOnline manual Structures of Linux

5 /sbinCommands necessary for system/sbinCommands necessary for system /varTemporary files and spool files/varTemporary files and spool files /devDevices/devDevices /etcSystem configuration files and startup shell scripts/etcSystem configuration files and startup shell scripts /boot-> how to select booting kernels/boot-> how to select booting kernels /dev/dev/cdrom /dev/floppy /dev/sd* /dev/hd* /dev/null/dev/zero/dev/dev/cdrom /dev/floppy /dev/sd* /dev/hd* /dev/null/dev/zero /etc/etc/fstab/etc/inittab/etc/etc/fstab/etc/inittab Structures of Linux

6 © 2004 Microprocessor Research Center of Peking University – All Rights Reserved Basic Operations What do these commands do?  shutdown/halt/reboot  w/who/whoami/whereis  ll/ls/ln  sync/mount  df/du/dd  head/tail  talk/write/wall  yes/no?

7 Tips No.2 Always Keep Security in Mind

8 Logging In Login the System –ssh –telnet –rsh –Using serial port to login (Kermit) Additional Tips –Login Sequence (what happed while login?) –Customize your own prompt –Forget your password?

9 ***Rule*** Do not login as root unless you have to root is the system super user (the “ master ” of Linux but more “ dangerous ” ) –Normal protection mechanisms can be overridden –Careless use can cause damage –Has access to everything by default root is the only user defined when you install –First thing is to change root ’ s password –The second job is to define “ normal ” users for everyday use

10 Tips No.3 Documents are very important & helpful

11 © 2004 Microprocessor Research Center of Peking University – All Rights Reserved  Man  What do these arguments mean?  cd ~cd –  mkdir -p mkdir -m  rm -i  cp –af / cp –rf  scp/rcp  echo –necho -e  touch  ctrl + c ctrl + z ctrl + u  shift+insertctrl+insert Basic Operations

12 © 2004 Microprocessor Research Center of Peking University – All Rights Reserved  grep  sed/awk  find  tar/gzip  ftp Little Tools

13 Shell Programming Exploit what a tool can do Use simplest tool for hardest job

14 Tips No.4 Be Open!

15 © 2004 Microprocessor Research Center of Peking University – All Rights Reserved  How to create an empty file without an editor? please give 3 methods.  What is the difference between the followings? and explain why. ./a.out > filename 2>&1 ./a.out 2>&1 > filename  Source code of a.out is shown at next page  How to get the date of yesterday and tomorrow? Homework

16 © 2004 Microprocessor Research Center of Peking University – All Rights Reserved #include main() { char* sin ="stdin\n"; char* sout="stdout\n"; char* serr="stderr\n"; write(0,sin, strlen(sin)); write(1,sout, strlen(sout)); write(2,serr, strlen(serr)); } Homework


Download ppt "Introduction to Linux shishu 2005-3-5 Microprocessor Research Center of Peking University Software Research Group © 2004 Microprocessor Research Center."

Similar presentations


Ads by Google