Introduc) On To Linux 2: Week 1 - Wednesday
Introduc) On To Linux 2: Week 1 - Wednesday
Week 1 - Wednesday
Llnk: A speclal Lype of le
Symbollc llnk (so llnk)
A le LhaL conLalns a reference Lo anoLher le
CreaLe a symbollc llnk wlLh ln
ln s TARGET LINK_NAME
CeL Lhe le LhaL a symbollc llnk polnLs Lo wlLh
readlink
non-symbollc llnk (hard llnk)
A dlrecLory enLry LhaL assoclaLes a name a le on a
le sysLem
Also creaLed wlLh ln
ulerence beLween
so llnk & hard llnk ?
A long sLory relaLed wlLh Lhe deslgn of Lhe le
sysLem
Some helpful LesLs
CreaLe a so/hard llnk Lo a regular le
CreaLe a so/hard llnk Lo a dlrecLory
CreaLe a so/hard llnk Lo a non-exlsLenL le
WhaL happen Lo a so/hard llnk lf Lhe LargeL le ls
removed
LnvlronmenL varlables
A seL of dynamlc named values malnLalned by
Lhe sysLem
used by many programs, as a soluuon of dynamlc
congurauon
A Lyplcal usage: speclfy locauons for programs Lo
search for resources
PATH
8ead/wrlLe a envlronmenL varlables
echo $VARIABLE_NAME
Pow Lo wrlLe?
!"#$%&%' ")#*+
lnLroducuon Lo Lmacs
An exLenslble, cusLomlzable, self-
documenung, real-ume dlsplay edlLor
Pas over 2,000 bullL-ln commands
Allows user Lo comblne Lhere commands lnLo
macros Lo auLomaLe work
uslng Lmacs Llsp, provldes a deep exLenslon
capablllLy
ur. LggerL conLrlbuLes Lo many Cnu pro[ecLs,
lncludlng ., Cnu Lmacs, ..."
reparauon
lnsLalllng Lmacs ln your ubunLu
sudo apt-get install emacs
Lmacs has boLh Cul and CLl
Lxecuung an Lmacs command
ShorLcuL key
LxlL Lmacs: C-x C-c
ulrecLly Lype Lhe name of Lhe command
M-x cmd <RET>
C" = cLrl, M" = alL (Wlndows)/opuon (Mac)
Movlng around
Le/rlghL/up/down
Pow Lo move fasLer?
Move by word
Move Lo Lhe sLarL/end of Lhe llne
Scrolllng
Movlng Lo a cerLaln llne
Why boLher Lo use Lhese keys lnsLead of Lhe
arrows, page up/down, home/end?
Lmacs's keyboard
Ldlung
lnserL & deleLe
Mark
SelecL a reglon Lo work on
(Copy/cuL/pasLe) klll & yank
nC1 CLrl+c -> CLrl+v" (noL uslng CS's cllpboard)!
Lmacs has lLs own klll rlng
klll: puL someLhlng (a word/llne/reglon/.) lnLo Lhe klll
rlng (=cuL)
Copy reglon Lo klll rlng (=copy)
?ank: pull someLhlng ouL of Lhe klll rlng (=pasLe)
klll 8lng"?
Search & 8eplace
lncremenLal search
Search forward/backword
Search wlLh a pauern (regular expresslon)
lnLeracuvely replace a LexL sLrlng
Lmacs as dlrecLory edlLor (ulred)
LnLerlng ulred: C-x d (dlred)
navlgauon
llagglng many les
llle operauons (copy/pasLe/deleLe/rename
/.)
mkdlr
hup://www.gnu.org/soware/emacs/
manual/hLml_node/emacs/ulred.hLml#ulred
Lmacs as shell
LxecuLe any shell command LhaL you run ln a
Lermlnal ln Lmacs
M-! cmd <RET>
?ou don'L need Lo exlL Lmacs Lo run your program
hup://www.gnu.org/soware/emacs/
manual/hLml_node/emacs/Shell.hLml
Lmacs as luL
LdlL Lhe source code
Complle Lhe program (bulld a execuLable from
Lhe source code)
M-x complle
1hen speclfy Lhe command Lo complle Lhe code
1lps for homework: gcc hello.c o hello
8un Lhe execuLable
8un Lhe shell command: ./hello
uebug wlLh gdb
hup://www.gnu.org/soware/emacs/manual/
hLml_node/emacs/Cu8-Craphlcal-lnLerface.hLml
8eference
8ullL-ln manual (C-h r) & LuLorlal (C-h L)
Cnllne manual:
hup://www.gnu.org/soware/emacs/
manual/emacs.hLml
Cun Lmacs 8eference Card