Next Previous Contents

8. Ry8mizontas to susthma

8.1 Arxeia arxikopoihshs systhmatos

Duo shmantika arxeia toy DOS einai ta AUTOEXEC.BAT kai CONFIG.SYS, poy xrhsimopoiountai kata thn ekkinhsh gia na arxikopoihsoyn (initialise) to susthma, na 8esoyn kapoies metablhtes periballontos, opws PATH kai FILES, kai pi8anws na ekkinhsoyn ena programma h arxeio batch file. Sto Linux yparxoyn polla eidh arxeiwn arxikopoihshs, me merika ek twn opoiwn kalutera na mhn asxolh8eite, ews otoy eiste sigoyroi gia to ti kanete. Ta shmantikotera einai:

ARXEIA                                   SHMEIWSEIS

/etc/inittab                            mhn to peirazete gia thn wra!
/etc/rc.d/*                             omoiws

An ayto poy 8elete einai aplws na 8esete thn PATH kai alles metablhtes periballontos, na allajete ta mhnumata login h na jekinate aytomata ena programma meta to login, deite ta akoloy8a arxeia:

ARXEIO                                   SHMEIWSEIS

/etc/issue                              8etei to mhnyma prin to login
/etc/motd                              8etei to mhnyma meta to login
/etc/profile                            8etei thn $PATH kai alles metablhtes, klp.
/etc/bashrc                             8etei ta aliases, tis leitourgies (functions), klp.
/home/your_home/.bashrc                 8etei ta proswpika sas aliases kai leitoyrgies
/home/your_home/.bash_profile   `h
/home/your_home/.profile                8etei to periballon kai ksekina ta programmata sas

An to teleytaio arxeio yparxei hdh (prokeitai gia kryfo arxeio), 8a diabastei meta to login, kai oi entoles toy 8a ektelestoun.

Gia paradeigma, koitajte ayto to .bash_profile:


echo Environment:
printenv | less   # equivalent of command SET under DOS
alias d='ls -l'   # easy to understand what an alias is
alias up='cd ..'
echo "I remind you that the path is "$PATH
echo "Today is `date`"  # use the output of the command 'date'
echo "Have a good day, "$LOGNAME
# The following is a "shell function"
ctgz() # List the contents of a .tar.gz archive.
{
  for file in $*
  do
    gzip -dc ${file} | tar tf -
  done
}
# end of .profile

Oi $PATH kai $LOGNAME, opws 8a katalabate, einai metablhtes periballontos. Yparxoyn polles akomh· gia paradeigmata, RMP sxetika me tis efarmoges less kai bash.

Bazontas thn parakatw grammh sto /etc/profile 8a exete to akribes antistoixo toy PROMPT $P$G:

export PS1="\w\\$ "

8.2 Arxeia arxikopoihshs programmatwn

Sto Linux ta panta sxedon mporei na ry8mistei stis anagkes sas. Ta perissotera programmata exoyn ena h perissotera arxeia arxikopoihshs ta opoia mporeite na mastorecete. Synh8ws onomazontai .onoma_programmatosrc ston oikeio katalogo sas. Ta prwta poy 8a 8elhsete na metatrecete einai:

Gia ola ayta kai gia osa synanthsete argotera, RMP. 8a sas endiefere isws na deite to Configuration HOWTO, http://sunsite.unc.edu/mdw/HOWTO/Config-HOWTO.html.


Next Previous Contents