linux introduction what is linux? how do you use it?

21
Linux Introduction What is Linux? How do you use it?

Upload: claribel-erica-welch

Post on 03-Jan-2016

236 views

Category:

Documents


0 download

TRANSCRIPT

Linux Introduction

What is Linux?

How do you use it?

cs490ns - cotter 2

Outline

• Linux Background

• Linux Basic Structure

• Linux User Interface

• Linux Commands

cs490ns - cotter 3

History

• 1991 - Linus Torvalds (Finnish student) looked for a development version of UNIX (other than Minux).

• Objective was to develop an open source version of UNIX that was functionally identical, but source code independent (as a hobby)

• Focus on the core operating system (the kernel)• Project took on its own life. Version 1.0 released

March, 1994

cs490ns - cotter 4

Design Capabilities

• Multi-tasking• Multi-user• Multi-processing (multiple processors)• Architecture Independence• File system Flexibility• Paging• Memory Protection (protected mode)• Networking

cs490ns - cotter 5

Kernel vs Distribution

• Kernel provides core OS functionality– managed by Linux.org (Torvalds, et.al.)

• Distribution provides installation and package management needed to implement a complete OS including applications– Red Hat (Fedora)– CentOS– Ubuntu– SuSe– Debian– many others

cs490ns - cotter 6

System Organization

• Like UNIX...

• Predefined root directory structure with preferred locations for kernel files

/ (root)

bin

boot

dev

etc

home

lib

mnt

proc

root

sbin

tmp

usr

var

cs490ns - cotter 7

System Organization

Directory Purpose

/ The root directory, which is the top of the file system.

/bin Critical executables needed to boot the system.

/dev Devices connected to the system, such as terminals, disks, tapes, modems, etc.

/etc System configuration files, including passwords, network addresses and names, system start-up settings, etc.

/home Location of users directories.

/lib The home of various shared libraries for programs.

cs490ns - cotter 8

System Organization

Directory Purpose

/mnt The point where file systems exported from another system are temporarily mounted.

/proc Images of currently executing processes on the system.

/tmp Temporary files that are cleaned up during the boot operation.

/usr A variety of system files, including standard system utilities (/usr/bin), manual pages (/usr/man), headers for C programs (/usr/include), and administration executables (/usr/sbin).

/var Directory that stores log files (/var/log) and temporary storage space for services (such as spooling for mail, printers, etc.).

. Current directory.

.. The directory just above the current directory.

cs490ns - cotter 9

Linux Security

• File Level Security– Authentication - allow only authorized users into the

system (user name, password)– Access control - Ensure that resources (files) are

only used by authorized users. (user id, group id, mode bits)

• System Level Security– Many of the same weaknesses as UNIX, since the

basic design is the same– Open source:

• Makes it easy for hackers to analyze the system• Easy for testers to fix the system when bugs are found.

cs490ns - cotter 10

User Interface Options

• Command Line Interface– Primitive Interface that requires little system support– Used on Embedded systems, old systems, some

servers– All Linux (UNIX) functions (commands) originally

developed for command line.– Commands defined in man 1

• (See also “Running Linux”)

– Change to GUI with “startx”

cs490ns - cotter 11

User Interface Options

• Graphical User Interface– Based on X Windows System

• X Server to generate display (bitmap)• X Client to present display to Video monitor

– Manages basic graphical display configuration• Display Resolution• Monitor type• Video Card• Input Devices

– Use Window Managers to provide GUI

cs490ns - cotter 12

User Interface Options

• GNOME– GNU Network Object Model Environment– Uses “Enlightenment” or “Sawfish” WM– Based on CORBA Architecture to support

interaction between objects (applications, components, etc.)

– Uses Nautilus File Manager

cs490ns - cotter 13

User Interface Options

• KDE– K Desktop Environment– Heavy use of Drag-and-drop– Includes Kongueror File Manager

• Integrates local file management with Web browsing

– Often extensive list of “K” applications and applets available.

cs490ns - cotter 14

Commands

• Installation / Update

• Schedule Programs / Jobs

• Check / Change Environmental Variables

• Manage Processes

cs490ns - cotter 15

Installation / Update

• Based on “packages” that include all files associated with an application / function

• Includes configuration information – directory locations, linkage to existing system config files.

• Most common is rpm – Red Hat Package Manager– Developed by Red Hat, but supported by many

Linux Distributions– Provides a method to test, verify, install, uninstall or

upgrade software (packages)

cs490ns - cotter 16

Automatically Schedule Programs

init

httpd

sendmail

inetd

ftpd

telnetd

tftpd

When trafficarrives for a service that inetd is listeningfor, inetd startsa process tohandle it

init startsvariousprocesses atboot time,includingnetwork services andinetd

Continuously listen on network for traffic for a

specific service

Listens for networktraffic for numerous

services

cs490ns - cotter 17

Manually Schedule / Run Programs

• cron– System program that will schedule jobs

• crontab– Users controlled by /etc/cron.allow or /etc/cron.deny– Specify H Min D Mon DOW command– crontab– 5 * 1,15 * * echo “turn in timesheets!” | mail cotterr– <EOT> “^D”

cs490ns - cotter 18

Manually Schedule / Run Programs

• at– Users controlled through /etc/at.allow or /etc/at.deny– Specify time [date] of execution– provide list (file) of commands / jobs to execute– at 11:21 Jan 5– at> /home/cotterr/bin/myscript.sh– at> cp /home/cotterr/info.txt /home/backup/info.txt– at> <EOT> “^D”

cs490ns - cotter 19

Environmental Variables

• printenv– Display all environmental variables

• echo $PATH– Display the contents of a single variable

• set $PATH=“$PATH:/sbin”– Temporarily add “/sbin” to search path

• set– Display all current variables

cs490ns - cotter 20

Manage Processes

• ps– Print status of all of your active processes

• ps aux– Print status on all active processes

• kill –s 9 PID– Terminate a process with process id PID

cs490ns - cotter 21

SUMMARY

• Linux Background

• Linux Basic Structure

• Linux User Interface

• Linux Commands