Disclaimer: The orgna verson of hs arce was frs pubshed on IBM deveoperWorks, and s
propery of Wesech Informaon Servces. Ths documen s an updaed verson of he orgna arce,
and conans varous mprovemens made by he Genoo Lnux Documenaon eam.
Ths documen s no acvey mananed.
LPl cerificaion 101 (release 2) examprep, Par 1
Conen: 1. Before You Sar
1. Before You Sar
Abou his uorial
Wecomeo "Lnux fundamenas," he frs of four uoras desgnedo prepareyou for he Lnux Professona
Insue's 101 exam. In hs uora, we' nroduceyou o bash(he sandardLnux she), showyou howo ake fu
advanageof sandardLnux commandske s, cp, and mv, expannodesand hard and symbocnks, and much
more. By he end of hs uora, you' havea sodgroundngn Lnux fundamenasand w evenbe ready o begn
earnngsomebasc Lnux sysemadmnsraonasks. By he end of hs seres of uoras (egh n a), you' have
he knowedgeyou needo becomea Lnux SysemsAdmnsraorand w be ready o aan an LPIC Leve 1
cerfcaon from he Lnux ProfessonaInsuef you so choose.
Ths parcuar uora (Par 1) s dea for hosewhoare newo Lnux, or hosewhowan o revewor mproveher
undersandngof fundamenaLnux conceps ke copyngand movngfes, creang symbocand hard nks, and
usngLnux' sandardex-processngcommandsaongwh ppenesand redrecon. Aonghe way, we' share
peny of hns, ps, and rcks o keephe uora meay and pracca, evenfor hosewh a goodamoun of prevo
Lnux experence. For begnners, much of hs maera w be new, bu more experencedLnux users may fnd hs
uora o be a grea way of roundngou her fundamenaLnux sks.
For hosewhohaveakenhe reease1 versonof hs uora for reasonsoher han LPI exampreparaon, you
probabydon' needo ake hs one. However, f you do pan o ake he exams, you shoudsrongyconsder readn
hs revseduora.
Abou he auhor
Resdngn Abuquerque, NewMexco, Dane Robbnss he Chef Archec of GenooLnux an advancedpors-based
Lnux mea dsrbuon. He asowres arces, uoras, and ps for he IBM deveoperWorksLnux zoneand Ine
DeveoperServces and has asoservedas a conrbungauhor for severa books, ncudngSambaUneashedand
SuSELnux Uneashed. Dane enoysspendngme wh hs wfe, Mary, and hs daugher, Hadassah. You can conac
Dane a drobbns@genoo.org.
2. lnroducingbash
The shell
Gentoo IInux ocuentatIon -- II certIIIcatIon 101 (reIease 2) exa prep, Iart 1
Are you running bash7
You can check o see f you're runnngbashby ypng:
CodeLising2.2: TheSHELLvariable
$ echo $ShELL
b1hbash
If he abovene gaveyou an error or ddn' respondsmaryo our exampe, hen you may be runnnga she oher
han bash. In ha case, mos of hs uora shouds appy, bu woudbe advanageousfor you o swcho bash
for he sakeof preparngfor he 101 exam.
Abou bash
Bash, an acronymfor "Bourne-aganshe," s he defau she on mos Lnux sysems. The she's ob s o obey your
commandsso ha you can nerac wh your Lnux sysem. Whenyou're fnshedenerngcommands, you may
nsruc he she o ex or ogou, a whch pon you' be reurnedo a ognpromp.
By he way, you can asoog ou by pressngconro-D a he bashpromp.
Using "cd"
As you've probabyfound, sarnga your bashpromp sn' he mos excnghng n he word. So, e's sar usng
basho navgaearoundour fe sysem. A he promp, ype he foowng(whou he $):
CodeLising2.3: Changingdirecories
$ cd
We've us od bashha you wan o work n /, asoknownas he roo drecory; a he drecores on he sysemform
a ree, and / s consderedhe op of hs ree, or he roo. cd ses he drecory whereyou are curreny workng, aso
knownas he "curren workngdrecory."
Pahs
To see bash's curren workngdrecory, you can ype:
CodeLising2.4: PresenWorkingDirecory
$ pwd