Sie sind auf Seite 1von 12

c

Linux Operating System

ccc c
 
 c
c c c
cc cc
c   cc c
cc c c
c  
c

c
c c
 c cc c
c

c cc c ccc c
 c
c ccccc
c

c

c c
c

Advantages of Linux
c Low costcc
  cc
c c
c c cc c
c
 c
c
c  c c cc c
cc
 c
 cc cc
  c  c   c  cc
c c
c
c
cc
 !cc
c cc c
"c Stabilitycc
cccc
  cc
 c
c c  cc
c c
c 

c c c c


cc

 c  c# cc $ c c
c
c
c%ccc

c  c
c c
cc
c
 cc
&c xerformancecc
c 
 cc 
 c
c
c 
'c%cc cc
c c c c
c c
c
(c aetworkingcc
c 
 cc
c
c
c 
'c 
)c  cc  c c c c c c c
cc
  cc
cIt can perform tasks like network backup more faster than other operating systems.c
*c ulexibilitycc
cc c  c c c c c
cc 
 c  c  
c '
c  
cc   c c+
c
cc
c c  c

 c
cc  c c+
c c
c  c c c
c  c
  c
,c ºompatibilitycc
%ccc

cc
 c  ' cc c 
cc

c c
c
-c èider ºhoicecc
  ccc c c
c c
c c c
cc c 
 c. c
$
c  
cc
c  c

c+
c c  'c c
 c
c' c )c c
 c 
!c c c c
/c uast and easy installationcc
c
c
 cc   c
cc
0c Detter use of hard diskcc
c cc 
 c c 
c  c c cc'cc
cc
1c rultitaskingcc
ccc'c
c c%c c cccc c c c
c Securitycc
cc
 c
c c
c  c
c c2 c
  cc 
c' cc
 c  c
"c Open sourcecc
ccc3 c
 c
c c+
c c c c c
 c
 c
ccc cc
c  
c
c 
c

c c


c cc c c
c
c c
 cc
 c c%cc ccoperating system used for high performance business and in
web serversc cc ccc  ccc
c

Linux Vs èindows
ccc
 
 c3 c4 c
 c c  c
 ccc 
c
c c34c cc  c c
c
  c  c
c 
 ccc  
c
c c


c

c
c
c
c !c  cc
 c
c
c34c+
c !c  c c c

 c
cccc
c
c  
c cc c 
 c
c  cc  c!c34c c !c c cc34cc
 c c34cc

5c
c
c6
c
 c
c7 

c c
 c
c  c
  c' c %
cc 
c# c8c44 c7' c9
c
4 ' cc

cc 
$ cc6
cc
c2
c   54 ccc 
c
c ccc
cc c
c'cc
 cc
c

  c
cc c  cccc 
c
c cc   c
c 
'c ccc cc c  cc

cc c c
c '
c
c
 c cc6
cc   c2
c  c c cc   c
  c
c6
c7 

c

cc c
c
c6
c
c c c
c
 c
  c+
c cc c
cc c
c
  cc
ccc c+
c c
c
c
c
c ccc cc 
c+
c c
cc

c
cc
c c c

ccc
  cc

ccc 
c
c  ccc6
cc

6
cc

c
cc c 
c c c

c
c  cc c 
c
cc
 c 
c cc   c 
c
6
cc

c
c ccc'c c c

c
ccc'cc c
  cc

6
c cc c c
cc c c  cc c  cc c c 
cc c34c: c c c
c
c c c cc

 c 
;c c cc   c 
c
cc c cc

6
c  c 
 ccc 'cc c c cc
c
ccc

6
c c c c
c  c  c c c c c2
c   c< <cc<=><c c  c cc c  cc6
cc

c  c
c c c cc

6
cc c c  c
 c
c c c  c6
c cc
  c c  c c c cc c
   c6
c c  c
c c  c
c   c  c  cc  cc'c 
c c cccc c  c ccc
<c?c<cc cc 
cc

cc
c
c c
 c
c c c%cc c c cc<cc<c c  c

%c c  c cc cc


 c 
cccc cc c c cc cc
c c c cc c  cc c
 cc' c c
c c ' c
cc
 c%c cc c
c c ' !c

Linux uile xermissions


c c c c
c 
c   c  c cc&c c
c c 
c c
c# c
"c6 cc
&c.  c

xermission sets in linux for files and directories


  cc 
c c
c c3 c
 cc3 c6 c
c c<c——c<c
cc c1c c
c c
c  c cV cccVc
Vc 

c c cc cc ccc 


 cccc 
c
c c"c&cc(ccc c
 !c 
c*c,cc-ccc

 !c 
cc/c0cc1ccc
c
 !c 
c5
c
c c   c
 cc
 cc ? c 
c
c
 !c c
c c 
cc
+
c c  c c 
c
cc ccccVVccc c
 c
 cc
 !cc 
c: ? ?   ;c

 c c c

xermission Sets

ac c c.  cc
ac "c c6 cc
ac & c6 cc.  cc
ac ( c# cc
ac * c# cc.  cc
ac ,c c# cc6 cc
ac -c c# c6 cc.  c

cccVVccc c c
 c
c c cc 
c c
 cc
 !cc c
c 
c
c c c c
3c c
 c
c c c c c c
c   c c c%c
cc
 cc
 c
c
c c c c
c c cc c
VVcc
Linux Directory Structure

<c?c<cc c

c@ 
cc c<c?

c<cc c c
 c 
c
c c

c c:
;c

cc c cc c



 c
 c c cc
 c c  c c
 c 
 c' c?c
 c?c?c?c  c. c cc c  c
c
 c
 
c

List of all the Directories in Linux


?cccccccccccccccccccccc Ac#

c
c cc 
c
B 

ccccccccccc Ac8
 c 
c
c c

c c
B 
 ccccccccc Ac !c
 c 
 c
BccccB  cccccc Ac c  c c c  c
BccccB  c
BccccB c
BccccB  c
BccccB  "c
B cccccccccccc Ac>
c  cc

 cc
c  cc
c c
B cccccccccc Ac ' ccc
c c
c  c
c
c ccc
B 
cccccccc Acc  cc
c
cc'ccc 
ccc
BccccBccc
BccccB ccccccc Ac5c 
cc
c
c 
c cccc
Bccc
B cccccccccc Ac>
cc
c cc  c  cc
c
c

c
BccccBcc
BccccB ccccccc Accc5
cc c
c
BccccB ccccc Accc4 cc
c
c  cc c

c  cc


BccccBc
BccccB   cccccc Ac8  c c
c c>c 
c cc
BccccBccc
BccccB ccccccccccccc Accc cc c
c 
cc c
BccccB 
cccccccccc Accc
c c
 cc
 c c
BccccB cccccccccc Accc8  c  c
BccccB 
cccccccccccc Acccc%
c
 c
BccccB 
cccccccccccc Acc@
 
c
c
c  ' c
BccccB  c
BccccB C#,cccccc Ac cCc
c c ccc
BccccBcccc
BccccB C&/,ccccccccccc Accccc ' cC#,cc
cCc   c*c
B 

ccccccccc Ac2 c cc c

 c
 c % 3cc9  c c
 c
B ccccccccccc Acccc4 c c  cc c 
c
c c

c  c
BccccB 
 cccc Acccc
 c'  c
 cc
Bcc
B  ccccccccc Accccc@  c c
c  c cc'c c c
c  c
B  cccccccc Acc>

c c  c
c c  c
BccccB ' ccccc Acccc2
c
 c 
c  
c
BccccB 
cccc Accc2 cc
 c cc c
c 
'c  c
B ccccc Acc>
c cc  c
cc c  c c  cc
BccccB  c
BccccB cccccccc Acc2 cc  c c c ccc
c
BccccB 
cccccc AcD cc
c 
c cc??
c
BccccB 
'cccccc Acc
'c cc ccc 
cc
BccccB 
ccccccc Acc
c c
c 
c cc
cc
c  c
BccccBccc
BccccB cccccc Ac2 cc
c

c
c c cc
BccccBccc
BccccB 

ccc Accc@ 
 c
cc  c

c cc
 c

 c
'c
BccccB  cccccc Accc 
c cc c  c
c c
c
 c cc
BccccBcc
B cccc Acc7
c
c
c 
c
cc c c
c
B  cccc Acc 
c cc 
cc c

 c
c c?? c

Linux Dasic ºommands

c
c ccc c  c  c c
c
ccc cc%cc c

c
c c c c
cc c
c

'c   cc c c
c c ccc 'c c c'
cc c+
c c

cc  cc c 
cc
c
c c c4
ccc c
c
c c c c
c
c
'cc c
c c
cc
c2c cc c
c
c
c
c c c  c c-c c
c c,c c c
c c%ccc c
c%c c+
c c

c
c  c cc5cEc>cEc2cc2"cc2-c. c cc F c
c  cc 
c
c
c%c
cc
c c c
 cc c  c  c:%;c  c5cEc2"cc c<'

 <c5cc c
cc c 
c
c c
c
c?
 ? c
 
cc
 c 
 ccc
cc
cG
 c c 
 c c  cc

Dasic commands in Linux

aavigation ºommands - [ pwd, cd ]

c
cc
cc c
cc c  c

c
c  c
'c 
c
cc
c.c
cH I",cJKLc c
c?
 ? c
cc
c c
cc
cc c
c  c c 
c+
c c
 c
c
 c 
c
c
 ccc
c2 c   c c c
 
c
cc
c>
  c
c cc 
c  c?
 ? ? ? ?cc cc c c 
 cc c
 c
cc
c.  cc
c>
 c
c cc 
c< <cc?
 ? c+
c  c
'c 
cc?
 ? c+
cc
c  c
c  c
'c
 
c
c?
 ? c
c?
 ? ? c c c

c
c
cH I",cJKLc c
c?
 ? c
cH I",cJKLc c c
cH I",cJKLc c
c?
 ? ? c
cc
c.  c"c
c%c
cc
c
 c 'c
c?
 ? c c c

c
c
cH I",cJKLc cc
cH I",cJKLc c
c?
 ? c
cc
c.  c&c
c
c c 'c
c c
 c 
c
c c c
cH I",cJKLc cJc
cH I",cJKLc c
c?
 ? c

Listing contents in a directory - [ ls, ls -l, ll ]

c
cc
cc c
ccc c cc 
cc c  c 
c
cc
c.c
cH I",cJKLcc
c*",0,/-1M c

'c3 @

c 
*" c
c &11M c@ '
c c  "M c
cc
cc c
cc
cc
cc
c c
ccc c cc 
 c8  c
cc c
 c c
c c cc 
 c   cc c
 c 
c+
cc c c 
c c  
c c c?c 
c$ c  c
cc
c.c
cH I",cJKLcc c
c
c*c
c    cc c c&&//c@ c""c1"*,c*",0,/-1M c
c    cc c c-,(-c5c0c"11,c*&((*/c
c    cc c c",/-c5c0c"11,c*&((--c
c c"c c c(10,cNc&c1("1c

'c
c c&c c c(10,c2 c(c1"&(c@ '
c

½eading files in Linux - [ cat, more, less ]


>c
cc
cc c
c c c
 c
cc c+
c c c c c
 cc c c
c
cc
c.  c
cH I",cJKLc c  c
cccc c c+
c c c c
cc
cc
c cc7
 c
c=
c c cc
 c
c  cc 
c c c c
c c c
 c  ccc c+
c c  c  c
c
 c
 c c c  c
c cc c c c c c
cc
c.  cc
cH I",cJKLc c  c
cccc c c+
c c c c
cc
c.  c"c
cH I",cJKLc
 c  c
cccc c c+
c c c c

ranipulating files - [ cp, mv, rm, mkdir ]


c
cc
cc c
c
c ? 
c
cc
c.  c
cH I",cJKLc c c 
c
ccc
c c c
c c 
c
cc
c c #c
cc
cc c
c
c 
 c  c:
cc c cc
 c c c 
;c
cc
c.  c
cH I",cJKLc c 
"c 
c
ccc
c c
 c 
"c
c 
c
cc
cc
cc
cc c
c
 c c c
c 
c
cc
c.  c
cH I",cJKLcc 
"c 
c
ccc
 c c
 c 
"c
c 
c
cc
cc
cc
cc c
c 
 c
c   c cc 
 c
cc
c.  c
cH I",cJKLcc 
"cc
ccc   c c 
c c 
"cc
cc
c'c
cc
cc c
c   cc c 
c
cc
c.  c
cH I",cJKLc'c 
&cc
ccc   cc c 
c c 
&c
c

create new file in Linux - vi editor


 cDc 
ccc c
c   c c cc cc

.  c
c  c
 c
cc
cc c
cc
c c c c
cc
c c  c<<c5 cc
c
 c  c<F<c
c c c c

Linux Server Administration ºommands

5c
cc c c Fc
c
c c c c?c  cc
8  c%c c c
 c
c
cc c c cc c c?c  c
cc

ºhecking running xrocess on the server. [ ps, pstree ]


c
c
cc c
c  'c c 
cc
c c  c<c c<c
cccc cc 
cc  c   c 
c
%@c

.  c


I  cHJKLc c
%@c+c%7.c>7@c
""(&/c ?&c111111cc
""(&0c ?&c111111cc
""*-c ?&c111111c c

 c c

c

c
c c
 c 
c

c
c c<c c<c
c


I  cHJKLc c c

5
c
c c cc  c 
c
c c  c


I  cHJKLc c cBc c c

 c
c
cc
c c c  'c c 
c
c c  c<c  c<c
cccc cc 
cc c
c
cc c
  c
.  c


I  cHJKLc  c


È È c
È c
Èc
È ' c
È(GH
 
 ÈÈÈ
  Kc

 
 ÈÈÈ 
ÈÈÈ*GH 
ÈÈÈ 
Kc
È  
c
È c
È ' c
È  ÈÈÈ  c
È 
c
È 
 c
È ÈÈÈ È È&GH Kc
cÈ  c
È"GH Kc
È ÈÈÈ"1GH Kc
È c
È Oc
È ÈÈÈ*,GH Kc
È   c
È'  c
È-GH'M
Kc
È'
c
È'
FO> 1c
È'
FO> c
È'
FO> "c
È'
FO> &c
È' c
È'  c
È ÈÈÈ/GH 
"(Kc
È
 c
È,GH Kc
ÈFO ÈÈÈFÈÈÈFÈÈÈ",GHFKc
È ÈÈÈ ÈÈÈ,GH Kc

 c
È  c
È   c
È1GH 
"(Kc
È O O1c
È ÈÈÈ"GH Kc
Èc
ÈÈ ÈÈÈÈÈÈÈÈÈÈÈÈÈc
cÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈÈ  c
È
c
È c

5
cc c

c

c
c<c  c<c


I  cHJKLc  c c


:;È È :-(/1;c
È :/,*/;c
È:/;c
È ' :,""(;c

 
 :,/&&;ÈÈÈ
  :,/&(;c

 
 :,/(1;ÈÈÈ
  :,/(;c

 
 :,/(,;ÈÈÈ
  :,/(-;c

 
 :,/*";ÈÈÈ
  :,/*&;c

 
 :,/*/;ÈÈÈ 
:,/*0;È È 
:,/-&;c
cÈ 
:,/-(;ÈÈÈ 
:",,(;c
cÈ 
:,/-*;ÈÈÈ 
:-(//;c
cÈ 
:,/-,;ÈÈÈ 
:/0(;c
cÈ 
:,/--;ÈÈÈ 
:"00*,;c

c
Load on a server [ top, w , uptime ]


cc

c
cc c
cc c
c
c c  c<c
c<c
c c
c c c
cc c 
cc cc  c
c
c c
  c%c c

c
c c
c 
c c 
c c$
 c 
c  c

.  cc

I  cHJKLc
c &cc

&"1&c c*cc"&*-c"c c


c  c(0*c*&c*0(cc

""1c 
 c"0c ccc1c$
 c1c
cc

> c c c c c cFc


Fc
c cc


c*Pc,Pc"(Pc11Pc11Pc11Pc0(&Pcc

11c&(Pc"/Pc"/Pc11Pc11Pc11Pc010Pcc

1c1&Pc&Pc11Pc11Pc11Pc11Pc0,*Pcc

1"c"*Pc1&Pc,*Pc11Pc11Pc11Pc01,Pcc

1&c11Pc1&Pc1&Pc11Pc11Pc11Pc00&Pcc

7 c&1(0&"'cc"010(&"'c c0**11'c c1'cc"/(*(/'ccc

"1*//'c  c**/&1('c  cc

4 c&11("'cc(000&,'c c"*1(-,'c c1*",('c   c

%@c4.#c #%c%c4%Q.c#44c485#.c45cP> cP7.7c%7.c> c>3775@cc

&-*(c

c,c1c"*"c"*"c/0,c#c(c11c11c"c
c &cc

&,"1c

c0c1c,(,1c(*7c"/-,/c4c1,c(c""&c1c??
?   ?? c @44 cc

&,1(cc0c1c("1(c(,c"/,c4c1"c1c111c1c??? c c F,1cc

"00*,c

c0c1c(,/(c&&/(c",(1c4c1c1c1&c1c?  ?? 
cc

c

c/c1c(,/c((1c(,c4c11c11c1&(c"ccH&Kc

2
c c
 c   c
c c c c
c  c
c 
 c c 
 cc c> c c+
c cc c
c  c:c
  c c
c  cc<c(0*c<c;c c 
c cc cc cc
c 
ccc cc

cc

c
cc
cc c
cc c
c c  c<cc<c
cc 
 cc c   
c
c c
c c c
c
 cc c  c
c c  c

.  cc


I  cHJKLccc

&0/c c,cc(cc"c c


c  c*&&c*&-c*-(cc

4.#c+c2#37c 3%Ic%@ .cN> c > c685cc

 c ?1c c c c/",c&&c110c111cc cH Kcc

 "c ?&c c c "c10c111c1&c11"cc "cH Kc

  cc

c
c c c c

c
c c  cc
c
c c  c

.  cc

I  cHJKLc  cc

("*"c c,cc/cc"c c


c  c(0c*&*c*,-c

2
c c
 c   c
c cc c
cc c c
cc  ccc
c c  c c

·illing process on a server [ kill, pkill, killall -9 ]

'cc

c
cc c
c'ccc 
c
c c  c+
c c
c 
cc
c   c c'c
c>
 c
cc<c  c c<c
 cccc c 
ccc   c 
cc
c'cc  c 
c c c
c<c'cR 
 Ac<c

.  cc

I  cHJKLc'c"-"10c

c

I  cHJKLc'c 0c"-"10c

 c
 c
cc'c c 
cc"-"10c

'cc

c
cc'c c c 
 c
cc  c 
c>
 c
cc'c c
c c  c

.  cc

I  cHJKLc 'c c

c

I  cHJKLc 'c 0c c

c

I  cHJKLc 'c 8 c c


 c
 c
cc
c'cc c c 
c
c<c c<ccc
c c  c 
cc cccc c c

cc c' c

'cc

c
cc c
c'cc c 
 c:c  c 
cc c 
c;c

.  cc

I  cHJKLc'c 0c c


c

ºhecking the number of connection's to the server [ netstat, mysqladmin processlist ]


 cc

c
cc c
cc c c
c
 
c
c c  c<c c<c
cccc c
 
cc c c c
 c+
c c c c  c
ccc c c
c
 
c
cc  c
c+
c cc c
c5 c2
 c5 c
4 c
c  c
cc c
 
c

.  cc

I  cHJKLc c c

c

I  cHJKLc c cBc c</1<cc

 c1c1c1111/1c1111Gc %4.c*(0,? cc

 c1c1c,*"*(&("/1c,*"(0"("(,0c4+O#.>Dc cc

 c1c1c,*"*(&("/1c--/"*&&0""c4+O#.>Dc cc

 c1c1c,*"*(&("/1c,*"*(1"/&(&c4+O#.>Dc cc

 c1c1c,*"*(&("/1c/*11"*"1/"*-c%7.O65%c cc

Fc 
cc

c
cc c
cc c
 
c
c cFc c%c c

c
c%c c8
cc>
c c4 cc
%
c
ccFc F c
c c  c

.  cc

I  cHJKLcFc 
cc

E E E E E E E Ecc

Bc%cBc cBc8
cBccBc>
cBc cBc4 cBc%
cBcc

E E E E E E E Ecc

Bc/,,-/cBcM O
cBc

cBcM O cBc4 cBc"/&&-cBcBcBcc

Bc//-1,cBcM O
cBc

cBcM O cBc4 cBc"-1*cBcBcBcc
Bc0*101cBc'


OcBc

cBc'

OcBc4 cBc"&1,0cBcBcBcc

Bc"1""-cBcM O
cBc

cBcM O cBc4 cBc0,**cBcBc c

Dlocking Ix [ apf, csf ]

5 2cc>42c c c


 cc

+
c c c  c
c
c
'cc  c% c
c
 c
c c  cc
ccc c c
cc

cc

 
c
cc  c% c
c

cc
 
cc cc 'c
c c  c4
ccc
c
c
'c c% c 
 cc
  c c c
c c  c

> 'c c cc c


c
c  cc cc
c

.  cc

I  cHJKLc c cR% Ac

c

I  cHJKLc c cR% Acc

ºhecking the port if open or not [ telnet, nmap ]


  cc

. .c:.
 
c.
';ccc 
'c 


c c
c c%  c. .ccc     c 


c c
cc  c

 

  c
cc
cc  cc
cccc  c
c
c c  cc
c
c
c

.  cc

I  cHJKLc  c

 
c/1cc

c,("&&/-00cc

>
  c
c

 
c:,("&&/-00;c

2
c c
 c   c
c
ccc
c/1cc
c
c

 c  c%c c  cc<c
 
c  c<ccc !c c
 c
cc
c
c
c c  c

 cc

c
c ccc 
'c  

c

ccc c  cc

Installing software͛s [ yum ]


cc

c
cc c
cc
 c
c c  c
cc   c

.  cc

ccR
 Ac
%c
ccc
 cc
c c  c
c c cccccc
c%ccc c  c
 c
c c
  c
c    c
c
c

èhat are Semaphores?


4  
 c c% >c c c
c  c 
 c
c 
$ c c c
c c 
 c

 c  c'c
c  
 cc  ccc  
 cc c c
c c:c
' c
c
' c;c
  c c' c cc c
c c 
 c
c   c c c 
 cc

6 cc 
cc   c c
cc 
 c   c c 
c c  c
c
'c c  
 c
 ccc
 
 c%c c  
 c c c  c
c
'cc c
' c c  cc  c
  c c c c
c
'c

6 c c 
c
   c c'cc
'c c 
 ccc 
 cc c   c
c
'cc  
 cc c  c
 c
' c cc
c  c c
'cccc
c
 c 
c c c c
c c 
 cc
 c

%c
c  
 c c
c c cccc c