Está en la página 1de 41

Lnux Bascs

Content

What s Lnux?

Lnux/UNIX Overvew

Instaaton

Usng the System

Wndows Vs Lnux
1. What s Lnux?

A free Unx-type operatng system


deveoped under the GNU Genera
Pubc Lcense.

Open source

Popuar

Support most of the patforms


avaabe
A Short Hstory of UNIX

Mutcs, AT&T Be Lab, GE, MIT

1969, UNIX, Ken Thompson, Denns Rtche

1973, Rewrte UNIX wth C

Berkeey UNIX(BSD UNIX)

1983, System V

Commerca products

SunOS, Soars, HP-UX, AIX, SCO UNIX

Standards

SVID, IEEE POSIX, X/Open XPG4.2


A Short Hstory of Lnux(1)
A Short Hstory of Lnux(2)
GNU & Lnux

GNU/Lnux System

Lnux kerne

GNU software/brary
Dstrbutons

Red Hat, Deban, Ubuntu


SuSe, Mandrake,
Redfag.
Mobe
Androd
GNU software/brary
Lnux kerne
3. Instaaton

Dstrbutons

Redhat

Deban

SuSe

Mandrake

Ubuntu

..

Lve CD

Ubuntu

KNOPPIX

Usng vrtua machne

Vmware

VrtuaBox
Instang Lnux

Boot system from bootabe meda

A nstaaton programs need to perform


essentay the same steps:

Choose anguage, keyboard type, mouse type

Create parttons

Setup a boot oader

Confgure network

Confgure user and authentcaton

Seect package groups

Confgure X (.e., the GUI)

Insta packages

Create boot dsk


Dsk Parttonng

At a mnmum, create

/, 750MB (1.5G or more recommended)

Swap, sze equa to twce the amount of memory

Recommended: /boot (16MB)

May need/want to create other parttons:

/usr, /usr/oca, /var, /tmp, /opt, /home

Defaut parttonng program under Lnux s


fdsk

Dstrbutons may add ther own parttonng


programs
Boot oader

A boot oader oads and starts the Lnux


kerne

Can pass boot parameters to the Lnux


kerne, such as devce nformaton

Can optonay oad an Inta Root Dsk

Can boot other operatng systems as we

Common Boot oaders:

LILO: Lnux Loader

GRUB: Grand Unfed Boot Loader

Generay confgured n /dev/hda, uness


other boot oader s used.
Lnux Startup Fow
power on
BIOS
boot oader
Lnux kerne
nt
system ready

BIOS

Checks memory, oads optons from


non-voate memory, checks for boot
devces, oads MBR of boot devce and
executes t

MBR

Contans a "boot oader" and the


partton tabe

Tradtonay set up by LILO/GRUB

Boot oader

Loads the compressed kerne mage


nto memory

The kerne uncompress tsef and


starts.

Int process

Confguraton fe /etc/nttab

run eves
4. Usng the System

Basc Knowedge

Workng wth Fes and Drectores

Workng wth Processes

Lnux Documentaton
Mut-user and Mut-taskng

Lnux s a mut-user, mut-taskng operatng


system

Mutpe users can run mutpe tasks smutaneousy,


ndependent of each other.

Aways need to "og n" before usng the system

Identfy yoursef wth user name, password

Mutpe ways to og n to the system

Consoe: Drecty attached keyboard, mouse, montor

Sera termna

Network connecton
Vrtua Termna

In most Lnux dstrbutons, the consoe


emuates a number of vrtua termnas

Each vrtua termna can be seen as a separate,


drecty attached consoe

Dfferent users can use dfferent vrtua termnas

Typca setup:

VT 1-6: text mode ogns

VT 7: graphca mode ogn prompt (f enabed)

Swtch between VTs wth At-Fn (or Ctr-At-Fn f


n X), where n ranges from 1 to 7
Lnux Commands

Everythng on a Lnux system can be


done by typng commands

the GUI (X-Wndow) s not needed for


runnng a Lnux System

In order to type commands n X-Wndow


you need to start a termna emuator

Command Prompt

Can be confgured by yoursef

$ - "ogged n as a reguar user",

# - "ogged n as root"
Command Syntax

Lnux commands have the


foowng fomat:
$ command opton(s) argument(s)

Exampes:
$ s
$ s -
$ s /dev
$ s - /dev
Some Basc Lnux Commands

passwd: Change your password

mkpasswd: Generate a random password

date, ca: Fnd out todays date and dspay a


caendar

who, fnger: Fnd out who ese s actve on the


system

cear: Cear the screen

echo: Wrte a message to your screen

wrte, wa, tak; mesg

..
Workng wth Fes &
Drectores

What s a fe?

A coecton of data;

An ob|ect that can be wrtten to, or read


from, or both. A fe has certan attrbutes,
ncudng access permssons and type.

Fe structure

Generay: byte stream, record sequence,


record tree

In Lnux: byte stream


Fe Types

reguar fe

Text or code data; no partcuar nterna structure

character speca fe

bock speca fe

Speca fes: represent hardware or ogca devces

Found n drectory caed /dev

ffo

socket

symboc nk

Drectory

A tabe of contents; a st of fes n that drectory


Fe System

What s Fe System

A coecton of fes and certan of


ther attrbutes. It provdes a name
space for fe sera numbers referrng
to those fes.

Fe System n Lnux:

VFS

EXT2, EXT3, EXT4, NTFS, FAT32, .


Drectory Structure

A Lnux drectores are contaned n


one, vrtua, "unfed fe system".

Physca devces are mounted on


mount ponts

Foppy dsks

Hard dsk partton

CD-ROM drves

No drve etter ke A:, C:, .


Man Drectores n Lnux
A Exampe of Drectory
Structure
Basc Commands(1)

Commands used wth drectores:

pwd: prnt workng drectory

cd: change drectory

mkdr: make drectory

rmdr: remove drectory

s: st the contents of drectores

-, -a, -R, -d optons


Basc Commands(2)

commands used wth fes:

touch: update the access and/or modfcaton tme of


a fes

cp: copy fes

mv: move and rename fes

n: nk fes

rm: remove fes

cat: concatenate fes

more/ess: dspay fes page by page

od, strngs: dspay bnary fes

spt: spts fes


Fe Permsson
Changng Permssons
Changng Permssons
(contd)
Defaut Fe Permssons

The permsson for newy created fes


and drectores are:
Fe: -rw-rw-r-- 644
Drectory: drwxrwxr-x 775

Why?

umask: an octa number whch contans the


bts that are NOT set as permsson bts.

Defaut 002 for norma user, 022 for root.


Defaut Fe Permsson

Defaut fe permsson: 666

Defaut drectory permsson: 777

Effectve permsson of a newy


created fe
=> Defaut permsson &- umask
Ouz
1. What s the effectve permsson
of a newy created fe f the
umask s set as 024?
2. What about for a newy created
drectory?
Edtng Fes

emacs

gedt

.
Workng wth Processes

What s a process?

A process s a task.

Process s a runnng nstance of an


appcaton.

An address space wth one or more


threads executng wthn that address
space, and the requred system
resources for those threads.
Workng wth Processes
(contd)

A runnng program s an exampe of a


process

A she s a process that reads your


commands and start the approprate
process.

echo $$
Startng and Stoppng a
Process

A processes are started by other processes

Parent/Chd reatonshp

One excepton: nt (PID 1) s started by the


kerne tsef

A tree herarchy

A process can be termnated because of two


reasons:

The process termnates tsef when done.

The process s termnated by a sgna from


another process
Basc Commands

ps: report process status

pstree: dspay a tree of processes

|obs, fg, bg, <ctr-z>: |ob controng

k:

nohup: run a command, gnorng


hangup sgnas

nce, rence:

top: dspay top CPU processes


Daemons
How to Fnd Hep?

"man" command

"nfo"

command --hep

HOWTO Documentaton

Refer to Internet
The man command

Wth the man command you can read the manua


page of commands

Manua pages are stored n /usr/man

The manua page conssts of:

Name: The name of the command and a onne


descrpton

Synopss: The syntax of the command

Descrpton: Expanaton of how the command works and


what t does

Fes: The fes used by the command

Bugs: Known bugs and errors

See aso: Other commands reated to ths one


Wndows Vs Lnux

También podría gustarte