Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006.

Similar presentations


Presentation on theme: "Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006."— Presentation transcript:

1 Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006

2 Rough Outline  Prerequisites:  Knowledge of basic Computer / Operating System concepts  No previous knowledge of Linux  No previous knowledge of Windows or any other systems  Training is divided into Two Parts:  Part I - Introduction of the background of Linux  Part II – Practical Session

3 Introduction to Linux ( I ) Part I – Some Background of Linux

4 What is “Linux”?  Operating system?  … What is an operating system?

5 What is an “Operating System”?  Wikipedia: “the system software responsible for the direct control and management of hardware and basic system operations”.  The kernel?  The basic interface (eg. command line, graphical interface)?  The commands? The tools?  Text editors? Compilers?  Web Browser?  … Everything?

6 Operating System (cont’d)  In general, there is one narrow usage and a broader usage  Narrow usage: Only the parts that deal directly with the hardware, and very low level features (i.e. the kernel)  Broader usage: Also includes system software. What is “system software” depends on the nature of the system.b

7 Graphical Illustration User space programs Shell Kernel Hardware X Client Daemons X Server

8 What is Linux?  There are also two usages of the term “Linux”, corresponding roughly to the narrow/broad usage of the term “Operating System”.  The narrow definition: simply the kernel  The broader definition: includes basically everything available in the system

9 A Typical Linux System  Linux Kernel  User space programs (many are GNU software)  Shell (command line): bash  Utilities: ls, cp, mv, rm, cat, grep,...  Compiler: gcc  … and more …  X Window System (for desktops/workstations)  Various daemons (a.k.a. services)  Eg.: syslogd, httpd, cron, inetd

10 A bit of History  Richard Stallman founded the GNU project in the 1980’s  Linus Torvalds began writing a kernel in the early 1990’s  => GNU/Linux, commonly referred to as “Linux”.  (For more details, see for yourself on the web)

11 Open Source / Free  Open Source – Source code is available to everybody  “Free” – Source code is available to everybody, and everybody can re- distribute the source code  “Copyleft” – Source code is available to everybody, and if you want to distribute the program, you must also distribute the source code.

12 Linux Distributions  Once upon a time, there were softwares  The softwares were scattered in different sites, and they were distributed by source code  If people wanted to use them, they have to download them from different sites, compile them, and install them  See how many packages you have in your system! (dpkg -l)  Also, consider the difficulty of installing software onto a new computer (with no operating system pre-installed)  Conclusion: Installation of software is a very complicated process.  (Refer to the LFS “Distribution” if you want to get a feel of this)

13 Linux Distributions (cont’d)  In the beginning, people did those complicated and tedious work themselves.  Later, some of them released their work of collecting the software to the public. These are called “distributions”.  Typically, a modern distribution handles the following:  Installation of the OS  Software Packaging (compiled software instead of source)  Install / Upgrade / Removing packages  Sensible default configurations  You may have heard of these names:  Redhat / Fedora  Mandrake  Debian  Slackware  Gentoo

14 Characteristics of Linux Systems  Heavy emphasis of command line  Many command line utilities for scripting purposes  Customizable

15 Introduction to Linux ( I ) Part II - Practical

16 Before Starting…  Remember that Linux is a completely different system from Windows. You may find that everything is different from what you are used to. Do not be frustrated. You may not yet be able to do everything you can in Windows, but after some time, you will be able to grasp the basics and feel more comfortable in using Linux  Also, forget all your “cool” Windows skills, and forget how you do things in Windows… the Linux way is quite different, especially if we focus on the CLI.

17 Login Screen “Message of the day” Usually contains important notices Username Hostname Current directory Hint: You may press to for multiple terminals if you are using Linux on the local machine (instead of over network) Why is the username and hostname displayed in the command prompt?

18 Getting Help  man pages Purpose of command Different usages Detailed description of command and its options Hint: Press ‘q’ to quit

19 More on Man Pages  There are different sections of man pages  Section 1: commands  Section 2: system calls  Section 3: C library calls  Section 4: special files (in /dev)  Section 5: (config) file formats  Section 6: “games”  Section 7: Misc  Section 8: System administration commands  If there are conflicts in names, the section of lower value is displayed. For a specific section:  man  man  Note that you may find section 3 very useful as a reference to standard C functions (eg. printf, fopen, string functions, etc)

20 Useful Commands in Competitions  bc – Arbitrary precision calculator  sort – Sort lines of text files (note the “-n” option)  ps – list running processes on the machine  kill – Sends a signal to running programs (terminates it by default)  date – Print system date/time  time – reports execution time of a command  diff – compares files  head, tail – prints the first/last N lines of the input  wc – word count (also counts characters and lines)  more – pager (allows you to scroll the input for easy viewing)  less – better version of more  grep – print lines matching a pattern  find – search for files  factor – factorize numbers  tsort – perform topological sort  seq – print a sequence of numbers  file – determine file type (sometimes displays other useful information)  tar – Archive files (“glue” multiple files into one, and vice versa)


Download ppt "Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006."

Similar presentations


Ads by Google