Download and more

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

OS/2 wikipedia , lookup

Berkeley Software Distribution wikipedia , lookup

RSTS/E wikipedia , lookup

Burroughs MCP wikipedia , lookup

VS/9 wikipedia , lookup

Acorn MOS wikipedia , lookup

Batch file wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Mobile operating system wikipedia , lookup

CP/M wikipedia , lookup

Linux kernel wikipedia , lookup

Unix security wikipedia , lookup

Mandriva Linux wikipedia , lookup

Caldera OpenLinux wikipedia , lookup

Linux wikipedia , lookup

Linux adoption wikipedia , lookup

Smallfoot wikipedia , lookup

Security-focused operating system wikipedia , lookup

Transcript
Introduction to Linux (I)
Sidney Fong
4th Feb 2006
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
Introduction to Linux (I)
Part I – Some Background of
Linux
What is “Linux”?
 Operating system?
 … What is an operating system?
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?
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
Graphical Illustration
Hardware
Kernel
Daemons
X Server
User space programs
Shell
X Client
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
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
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)
Open Source / Free
 Open Source – Source code is available to
everybody
 “Free” – Source code is available to
everybody, and everybody can redistribute 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.
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)
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
Characteristics of Linux Systems
 Heavy emphasis of command line
 Many command line utilities for scripting
purposes
 Customizable
Introduction to Linux (I)
Part II - Practical
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.
Login Screen
“Message of
the day”
Usually contains
important notices
Username
Hostname
Current directory
Why is the username and hostname
displayed in the command prompt?
Hint: You may press
<Ctrl+Alt+F1> to <Ctrl+Alt+F6>
for multiple terminals if you are
using Linux on the local machine
(instead of over network)
Getting Help
 man pages
Different
usages
Detailed
description of
command and
its options
Purpose of
command
Hint:
Press ‘q’ to quit
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 <section> <page>
 Note that you may find
section 3 very useful as
a reference to standard
C functions (eg. printf,
fopen, string functions,
etc)
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)