Sistema de Ficheros y Comandos Basicos

download Sistema de Ficheros y Comandos Basicos

of 23

Transcript of Sistema de Ficheros y Comandos Basicos

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    1/23

    INSTITUTO TECNOLOGICO DE

    VERACRUZ

    TALLER DE SISTEMAS OPERATIVOS

    TEMA: SISTEMA DE FICHEROS Y 

    COMANDOS BASICOS

    UNIDAD 3

    ING. SISTEMAS COMPUTACIONALES

    HORA CLASE: 16:00 – 17:00 PM

    EQUIPO 3

    PERIODO ENERO – JUNIO 2016

    H. VERACRUZ, VER., 10 MAYO DEL 2016

    3.1 SISTEMA DE FICHEROS

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    2/23

    T!"# $! L%!&' (#)# $! U!%', "#* + %!#-)(%! /$-)!$!"$

    (($%+$ $ )#!" #-$ &! !%( $"-&("&- *$ %(3$-# $! 4-#+

    *$!#)%!* %"$) *$ %(3$-#. P#- +# "!"#, 5 *%$-$!(% *$ +#

    %"$) *$ M%(-##" (#)# MSDOS # + )%+% %!*#8, 9& $+

    !#)-$ (#)/+$"# *$+ %(3$-# !# %!(+&5$ $+ *%/#%"%;# $! 9&$ -$%*$ , % !# 9&$ $"4 (#)/&$" /#- & -$(#--%*# $! $+ !%(# 4-#+

    9&$ $ #-) (#! + %!"$?-(%! *$ +# %(3$-# *$ "#*# +#

    *%/#%"%;#, $ *$(%-, $+ )$!(%#!*# S%"$) *$ @%(3$-#.

    M%$!"- $+ (#)/&"*#- $"4 /?*#, + &!%**$ 5 /-"%(%#!$

    )!"%$!$! + %!#-)(%! *$ & /-#/%# %(3$-# 5 + $"-&("&- 9&$

    #-)! %!"$-!)$!"$

    /$-# (&!*# $+ %"$)

    $ /#!$ $! )-(3

    "#* + %!#-)(%! *$

    $# *%/#%"%;# $

    (#)%! 5 #-?!% $!

    &! !%( $"-&("&-

    $! #-) *$ 4-#+. E!

    + (-$(%! *$ *%(3

    $"-&("&- #!

    &!*)$!"+$ +#/$-(%#!$ *$

    )#!"=$ ++$;*

    (# /#- $+ (#)!*#

    mount 5 $+ %(3$-# *$ (#!%?&-(%! /etc/stab.

    P#- (* %(3$-# 9&$ $ (-$ $ +)($!! $! $+ *%(# *# "%/# *$

    %!#-)(%! /#- &! +*# $+ (#!"$!%*# /-#/%# *$+ %(3$-#, 5 /#- #"-# &

    %!#-)(%! *$ (#!"-#+ # *$(-%/"#-.

    E+ descriptor (#!"%$!$ $+ !#)-$ *$+ %(3$-#, "%/#, $'"$!%!, +#!?%"&*,/-#/%$"-%# $ %!#-)(%! *$ (#!"-#+, "#*# $++# +)($!*# $! &!

    $"-&("&- 9&$ $ (#!#($ $! $+ )&!*# UNIB (#! $+ !#)-$ *$ inodo.L in!ormaci"n #-$ $+ "%/#, /-#/%$"-%#, ?-&/#, )#)$!"# *$ (-$(%!5 +"%) ("&+%(%#!$ 5 (#!&+", (#)# +# *$-$(3# *$

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    3/23

    (($# -$&+"-4 &!*)$!"+)$!"$ /- + ?$"%! *$+ S%"$)

    O/$-"%;#. L %!#-)(%! *$ (#!"-#+ (#!"$!%* $! $+ %!#*# $ /&$*$

    (#!&+"- /#- )$*%# *$+ (#)!*# #s $#% )%$!"- 9&$ /- ;%&+%- $+(#!"$!%*# $ &-! +# (#)!*# more o cat &salvo para ficheros

    binarios o comprimidos) .

    C&!*# $ %!%(%+% &! *%(#, /-"%(%! # *%9&$"$ $ ;( 5 /-$/-

    "!"# + #! *$ *"# (#)# + *$ *$(-%/"#-$ $" #/$-(%! $ +$

    &$+$ ++)- #-)"$- 5 /- $++# $'%"$ $+ (#)!*# m'!s.

    E+ (#!($/"# *$ @%(3$-# $! U!%' $ $/$(%+)$!"$ $'"$!#, 5 9&$

    *$)4 *$ +# %(3$-# (#)&!$ # -(3%;#, ")%! "%$!$! $!"%** *$

    %(3$-# =&!"# (#! & %!#*# #(%*#, #"-# $+$)$!"# *$(%%;# $! +

    ?$"%! *$ %"$) (#)# +# %?&%$!"$:

    • DIRECTI(OS) C#!=&!"# *$ %(3$-# 9&$ #-)! !#*# $! +

    $"-&("&- *$ 4-#+ 5 (&5# %! $ #-?!%- + %!#-)(%!. U!

    *%-$("#-%# /&$*$ $!(#!"--$ *$!"-# *$ #"-# 5 $"# $ +$ &$+$

    ++)- &*%-$("#-%#. L# &*%-$("#-%#, # *%-$("#-%#, (#)# $

    /-$%$-, $ (-$! /#- )$*%# *$+ (#)!*# m'dir  5 +# %(3$-#(#!"$!%*# $! $+ *%-$("#-%# $ /&$*$! (#!&+"- (#! $+ (#)!*#

    #s.  P- %- ()%!*# *$ &! *%-$("#-%# #"-# $ &"%+% $+(#)!*# cd.

    • E*+ACES) E! #(%#!$ /&$*$ -$&+"- %!"$-$!"$ 9&$ &!

    %(3$-# # *%-$("#-%# $ $!(&$!"-$ *%/#!%+$ *$*$ ;-%# /&!"#

    *$+ 4-#+ *$ %(3$-#, (#)# /#- $=$)/+# $! $+ (# *$ %(3$-#

    (#)/-"%*#. E" &!(%! $ +#?- )$*%!"$ +# *$!#)%!*#

    $!+($, (-$*# (#! $+ (#)!*# #n.• FICHEROS ES,ECIA+ES DE DIS,OSITI(O) S#! %(3$-#

    *$(-%/"#-$ *$ *%/#%"%;# *$ ES, 9&$ &$+$! -$%*%- $! $+

    *%-$("#-%# /de-.• OTROS) E'%"$! #"-# "%/# *$ %(3$-# *)%"%*# /#- $+ S%"$)

    O/$-"%;#, (#)# +# @I@O /- (#)&!%((%! %!"$-! $!"-$

    /-#?-), +# soc'ets /- + (#)&!%((%! "-; *$ +R$*.

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    4/23

     A+ *$!#)%!- &! %(3$-#, $ &!*)$!"+ (#!#($- & &%((%! $! $+

    4-#+ *$ %(3$-# *$+ S%"$), 5 9&$ & !#)-$ 9&$*- #-)*# /#- 

    $+ ()%!# 9&$ 35 9&$ -$(#--$- *$!"-# *$+ 4-#+.

    DIRECTORIO ACTA+ O DE TRAA0O) E+ (#)!*# cd/$-)%"$ ()%-+# 5 pd ;%&+%-+#. S% $+ !#)-$ *$+ %(3$-# !#$)/%$ /#- (-("$-$, $!"#!($ + *$!#)%!(%! $ -$%$-$

    $"$ *%-$("#-%# 5 $ 3+ *$ ()%!# -$+"%;#. P#- $=$)/+#, +#

    !#)-$ !ic2% dir1/!ic2% /!ic23 o .. /dir/!ic24 #! ()%!#-$+"%;#.

    • DIRECTORIO RAI5) S$ -$/-$$!" /#- $+ (-4("$- -- 5 $

    $+ *%-$("#-%# - !%(# *$+ %"$) *$ %(3$-#. C&!*# &!

    $+$)$!"# $ +$ 3($ -$$-$!(% *$ $"$ )#*#< & !#)-$

    (#)%$! (#! (-4("$- > $ ++) ()%!# #+&"# 5 $! $$

    (# $+ *%-$("#-%# ("&+ !# $ "%$!$ $! (&$!". P#- $=$)/+# $+

    %(3$-# /etc/stab -$/-$$!" $+ ()%!# #+&"# *$+ %(3$-# !stab.• DIRECTORIO RAI5 DE +A CE*TA) C* (&$!" "%$!$ (-$*#

    5 %?!*# &! *%-$("#-%# - /$-#!+ 9&$ $-4 $+ *%-$("#-%#

    ("&+ (* ;$ 9&$ (#)%$!($ "-=- "- -%- &! $%!.

    D$!"-# *$ +# ()%!#, %$! $! #+&"# # -$+"%;#, $+ (-4("$- $

    &! $/-*#- 9&$ %!*%( &! *$($!# $! $+ 4-#+ *$ %(3$-#. D$ $"$)#*#, "#*# +# !#)-$ 9&$ $ $!(&$!"-! + %9&%$-* *$ $"$

    (-4("$- $-4! *%-$("#-%#. C#)# $ $+ $! +# (#)!*# 5

    )$!(%#!*# $! (&+9&%$- *%-$("#-%# *$+ S%"$) *$ @%(3$-# $+

    (-4("$- . &punto6 %!*%(- $+ /-#/%# *%-$("#-%# 5 + $(&$!(% *$ *#/&!"# .. $+ *%-$("#-%# &/$-%#-.

     A (#!"%!&(%! $ %!*%(! +# ()%!# #+&"# *$ +# *%-$("#-%# )

    -$/-$$!""%;# 5 &"%+%*# $! +# S%"$) L%!&'.

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    5/23

    3. COMA*DOS ASICOS

    C#)# $ $;%*$!"$ 5 5 $ 3 *%(3#, /- $- &! &$! *)%!%"-*#- $

    %)/-$(%!*%+$ (#!#(%)%$!"# 5 /$-%(% $! $+ &# *$+ S%"$) (#)#

    &&-%#. P- $++#, $ &!*)$!"+, *$)4, &! 4?%+ 5 $?&-&"%+%(%! *$ +# (#)!*# 4%(# *$ U!%' 5, /#- +# "!"#, *$ L%!&'.

     A&!9&$ 5 $ 3! !#)-*# +?&!# *$ +# (#)!*# 3%"&+$ $!

    $" $((%! $ 3($ &! -$/# *$ +# (#)!*# %)/-$(%!*%+$

    %$)/-$ *$ #-) -$&)%* 5 (#! + 5&* *$ +# $=$)/+#. P- &!

    (#!#(%)%$!"# )4 *$"++*# *$ +# )%)# !* )$=#- 9&$ /#!$-$

    *$+!"$ *$+ (#)/&"*#- 5 -$(&--%- +# (#)!*# *$ 5&* man 7apropos.

    3..1 FORMATO DE +OS COMA*DO 8METACARACTERES

    L #-) ?$!$-+ *$ $(-%%- +# (#)!*# $ + %?&%$!"$. L

    #/(%#!$ /-$($! $!"-$ +# (#-(3$"$ /#-9&$ /&$*$! !# !$($%"-$

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    6/23

    5 $+ !&)$-# *$ +# /-4)$"-# ;-%- $! &!(%! *$+ (#)!*#,

    /&*%$!*# %!(+&# $- #/(%#!+$.

     A*$) *$ +# $+$)$!"# $!&!(%*# $! $+ #-)"# ?$!$-+ *$ +#

    (#)!*#, ")%! /&$*$! /-$($- (-("$-$ $/$(%+$ 9&$

    )#*%%9&$! $+ (#)/#-")%$!"# *$ +# (#)!*# # /-#?-) 9&$ $

    /#!$! $! $=$(&(%!:

    9 I!*%( -$*%-$((%! *$ + $!"-* $"4!*- + %(3$-# 9&$ $ $/$(%%( (#!"%!&(%!.

    : S%-;$ /- -$*%-$((%#!- + +%* $"4!*- &! %(3$-#, /#- +# 9&$+# -$&+"*# !# $ ;$-4! $! + /!"++.

    :: S$ & (&!*# +# -$&+"*# $ 9&%$-$! -$*%-$((%#!- &! %(3$-#5 $'%"$!"$ *%!*#+# + %!+.

    99 S$ & $! +# %(3$-# *$ (#)!*# # (-%/", (&!*# +# *"# *$$!"-* *$ &! (#)!*# $ 9&%$-$! $/$(%%(- (#!"%!&(%! $! +&?- 

    *$ "$!$-+# 9&$ "$(+$- # "#)-+# *$ #"-# %(3$-#.

    : R$*%-$((%#!- +# )$!=$ *$ $--#-, /- 9&$ !# $ %!"$-(+$! (#!+# -$&+"*#. P#- +# "!"# 35 *%"%!" #/(%#!$: -$*%-$((%#!- +

    +%*, +# $--#-$ # )#.

    ;  I!*%( 9&$ )%$!"- $"$ $! )-(3 $+ (#)!*# $=$(&"*# $9&%$-$! %!"-#*&(%- !&$;# (#)!*#.

    L# )$(!%)# *$ -$*%-$((%! #! )&5 %!"$-$!"$ /- + "-$

    *$ *)%!%"-(%!, 5 9&$ /$-)%"$! $+ +)($!)%$!"# /$-)!$!"$ *$

    )$!=$ *$ +# /-#?-), )&5 "%+ /- "-$ *$ (#!"-#+ 5

    ;$-%%((%!.

    L# /-4)$"-# *$ +# (#)!*#, $! #(%#!$ $ *$$ 3($- -$$-$!(% ;-%# %(3$-# *$ !#)-$ %)%+-. P- (%+%"-!# + "-$

    $+ %"$) #-$($ +# metacaracteres 5 9&$ 4%()$!"$ #!)#+# 9&$ 5&*! &)$!"- + $'/-$%;%**. T)%! $ &!

    (&!*# !# -$(#-*)# $+ !#)-$ *$ +# %(3$-# # *%-$("#-%# 5

    9&$-$)# &(-+#. A (#!"%!&(%! $ )$!(%#!! +# ) &"%+%*#:

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    7/23

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    8/23

    Head -100 fich1 # 100 primeras líneas

     A+ %?&+ 9&$ $! $+ (# *$ + ($($-, ")%! $ /#%+$ (#!&+"- +

    (#+ # (#!=&!"# *$ &+"%) +!$ *$ &! %(3$-#. P- $++# &"%+%-$)#

    $+ (#)!*# tai#.

    tail -100 fich 1 # ultimas 100 lineas

    tail +50 fich1 # líneas posteriores a las primeras 50 

    P- ;$- ()#*)$!"$ $+ (#!"$!%*# *$+ %(3$-# /#- + /!"++ $'%"$!

    +# (#)!*# more 7 #ess.

    • MORE) $ $+ (#)!*# $"4!*- $! U!%'.• +I*@) N# +# #-$($ L%!&' 9&$ $ ) +$'%+$ + 3#- *$

    )#;$-$ /#- $+ (#!"$!%*# *$+ %(3$-#. E! )# $ /&$*$! &- 

    $'/-$%#!$ -$?&+-$ /- &(- &! (#!"$!%*# (#!(-$"#.

    More fich1

    Less fich 

    E+ (#)!*# cat ")%$! !# )&$"- $+ (#!"$!%*# (#)/+$"$ *$ &!%(3$-#. S%! $)-?#, -$*%-$((%#!!*# + +%* $"4!*-, ")%!

    /&$*$ &"%+%-$ /- (#!("$!- ;-%# %(3$-# $! &!# #+#.

    !at fich1 # ver en pantalla fich1

    !at fich1 fich fich" fich$total # encadenar fich1% fich & fich" # & 

    'uardar en fich$total(

    3..3 MA*E0O DE FICHEROS) CO,IA% CAMIO DE

    *OMRE% ORRADO% IM,RESI*..Copia de !ic2eros) (/. S$ *$$! $/$(%%(- *# /-4)$"-#, $+%(3$-# &$!"$ 5 $+ !#)-$ *$ + (#/%. S% $! $+ $?&!*# /-)$"-# $

    $/$(%%( &! *%-$("#-%#, $ (#/%- $+ %(3$-# $$ *%-$("#-%#

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    9/23

    )!"$!%$!*# $+ !#)-$ (#-"#, /$-# !# & ()%!# #+&"#, (#)# $

    +?%(#.

    cp fich1 fich # copia con otro nombre

    cp fich1 dir # copia en otro directorio

    Re nominaci"n de !ic2eros o cambio de ubicaci"n) m- . E! )#(# )#*%%( $+ ()%!# ##+&"#, % $+ $?&!*# /-4)$"-# $ &!

    *%-$("#-%# ()% *$ &%((%! 5 % $ &! %(3$-# "! #+# ()% &

    !#)-$. A *%$-$!(% *$+ (#)!*# cp !# $ /-#*&($ &! !&$;# %(3$-#.

    mv fich1 fich # renombrar 

    mv fich1 dir # mover fich a dir 

    orrado de !ic2eros rm) S$ *$$ &- (#! (&%**# 5 9&$ , $+/-%!(%/%#, !# $ /#*- -$(&/$--. S$ -$(#)%$!* $+ &# *$ + #/(%! $i5 9&$ $+ %"$) /%* (#!%-)(%!. S$ /&$*$! &"%+%- 

    )$"(-("$-$ (#)# .

    rm fich

    rm i * #borrar todos los ficheros del directorio actual #pidiendo

    confirmacin 

    Creaci"n de en#aces)  E+ (#)!*# I! /$-)%"$ *%- $!+($ &!%(3$-#, *$ "+ )#*# 9&$ (-$ !&$;# ()%!# #+&"# /- ++$?-

    *%(3# %(3$-#. A&!9&$ !# (-$ (#/% *$ %(3$-#, /- #---+# 3-4

    9&$ $+%)%!- & *# $!+($, /#- +# 9&$ $! /-%!(%/%# $ !$($%"-!

    *# (#)!*# rm

    ,n fich$vieo fich$nuevo

    ,n s dir$ vieo dir$ nuevo

    P-$/-(%! *$ +# %(3$-# /- & %)/-$%!: /- D #-)"# + %(3$-#

    /- & %)/-$%! *%;%*%!*#+# $! /?%! # (#+&)!.

     pr fich

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    10/23

    Impresi"n de !ic2eros #pr. L %)/-$%! $ -$+% $! )#*#*%$-%*# 5 9&$ L%!&$' $ &! %"$) )&+"%/&$"#. P#- +#

    "!"# $ (#/% /$-)!$!"$)$!"$ $! &! %(3$-# *$+ S%"$) 5 $

    %)/-%)%-4 (&!*# + %)/-$#- $ $!(&$!"-$ +%-$.

    lpr fich1 # en la impresora por defecto

    lpr .laser fich # en la impresora de nombre laser 

    C#!&+" *$ + (#+ *$ %)/-$%!: +/9

    lp/ .lineas #cola de impresora de nombre líneas

    3..4 E0EM,+OS

    • E+%)%!- "#*# +# %(3$-# *$+ "%/# "'":

    rm *(tt • E!(*$!- 5 )#"-- $! + /!"++ "#*# +# %(3$-# (&"#

    !#)-$ "$!?! &! +#!?%"&* *$ (&"-# (-("$-$, (#)%$!($!

    /#- -$( 5 $! *$ tipo tt(cat frec?(tt 

    • I)/-%)%- -$(1, -$(2 5 -$(:

    lpr frec 1-"2(tt • C#/%- $+ %(3$-# %(31 (#! $+ !#)-$ %(32 < $! *# )#*#

    *%"%!"#>cp fich1 fich cat fich1 fich 

    • O"$!$- + 20 /-%)$- +%!$ *$+ %(3$-# %(31 5 (&)&+-+ $!

    $+ %(3$-# (:head -0 fich1 cab

    • G&-*- $+ )!&+ *$ (#!&+" *$+ %!"$-/-$"$ *$ (#)!*# 3 $!

    $+ %(3$-# +%1 5, )%$!"- "!"#, /#*$- $?&%- "-=!*#man sh lis1 3

    3..B COMA*DOS ,ARA MA*E0O DE DIRECTORIOS

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    11/23

    • V%&+%(%! *$+ *%-$("#-%# ("&+: ,D• M#*%%((%! *$+ *%-$("#-%# ("&+: (*, E &! (#)!*# )&5

    &"%+%*#, 5 9&$ !# /$-)%"%-4 ()%!# -$+"%;# ) $!(%++#:

    CD DIREC• C-$(%#! *$ &! &*%-$("#-%#: MDIR $ MDIR DIREC• E+%)%!(%! *$ &*%-$("#-%#: % $"4 ;(%# -)*%-. E! ()%#, % $+

    *%-$("#-%# !# $ $!(&$!"- ;(# "$!$)# *# #/(%#!$. L

    /-%)$- (#!%"$ $! #--- & (#!"$!%*#

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    12/23

    P-#/%$"-%#: %*$!"%%((%! *$+ &&-%# 9&$ 3 (-$*# $+

    %(3$-#. G-&/#: G-&/# *$ "-=# (#--$/#!*%$!"$ + /-#/%$"-%#.

    T)#: O(&/(%#! *$ +# *"# *$+ %(3$-# $! 5"$.

    N#)-$: N#)-$ (#-"# *$ +# %(3$-# *$+ *%-$("#-%#,*$)4 *$ *# !#)-$ $/$(%+$ 5 (#)$!"*#.

    3.. E0EM,+OS

    • C-$- $+ *%-$("#-%# /-&$:

    m:dir prueba• C#/%- $+ (#!"$!%*# *$ +# $=$(&"+$ *$ 3$* 5 "%+ *$+

    *%-$("#-%# &-%! + *%-$("#-%# /-&$.cp ; usr;bin;head pruebacp ;usr;bin;tail prueba

    • E"+$($- $+ *%-$("#-%# /-&$ (#)# *%-$("#-%# ("&+:

    (* /-&$

    • C#)/-#- $+ *%-$("#-%# ("&+

     p

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    13/23

    echo Genlaces9 I@AL echo Gtipo 9 I,.7 echo Glon'9 IL7AC b&tes 

    done

    3.. OTROS COMA*DOS ,ARA +A GESTIO* DEFICHEROS

    P- #"$!$- )$!=$ /#- /!"++: ec2o. S#+# $ &$+$ &"%+%- $! +# (-%/" 5 %! *$ #"$!$- %!#-)(%! #-$ + $=$(&(%!

    *$ +# (#)!*#.

    •  7rdenacin del contenido de un fichero línea a línea9 sort(

    sort fichsort nr fich # n- clasificacin numJrica% r- orden inversosort + fich # la clave de ordenacin es el se'undo

    campoKpalabra)

    • E+%)%!(%! *$ +%!$- -$/$"%* (#!"%?&. ni. S$ &$+$ &- 

    "- $+ (#)!*# #-" 5 (#! + #/(%! –( %-;$ /- (#!"- +

    +!$ -$/$"%*.

    uni/ c fich # eliminar líneas repetidas & contar cada tipo(

    • C4+(&+# *$+ !)$-# *$ +!$, /+- 5 (-("$-$ *$ &!

    %(3$-#: 8(. S% #+# !# %!"$-$ $+ !)$-# *$ +!$

    $/$(%%(-$)# + #/(%! –+.

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    14/23

    diff fich1 fich 

    3.. FICHEROS DE COMA*DOS

    L +!$ *$ (#)!*# $ /&$*$! +)($!- $! %(3$-# (#! $+

    #=$"%;# *$ (-$- !&$; &!(%#!$ 9&$ $!(*$!$! + $=$(&(%!,

    ;$($ (#!*%(%#!+ # %"$-"%;, *$ (%$-"# (#)!*#. E"#

    %(3$-# *$ (#)!*# $ *$!#)%!!  scripts  5 $! $++# $/$-)%"$!, (#)# $ $'/+%( $! $+ ANEBO , (-("$-"%( *$ +#

    +$!?&=$ *$ /-#?-)(%! (#)# ;-%+$, $"-&("&-

    (#!*%(%#!+$ $ %"$-"%;.

    3..1J E0ECCIO* CO*CRRE*TE

    C&!*# $+ "%$)/# *$ $=$(&(%! *$ &! (#)!*# $ +-?#, 5

    *$)4, !# !$($%" %!"$-((%! *$*$ $+ "$(+*#, (#!;%$!$

    /#*$- %!"-#*&(%- !&$;# (#)!*# *&-!"$ + $=$(&(%! *$+(#)!*# !"$-%#-. S$ * + )%) %"&(%! (&!*# $+ !&$;#

    (#)!*# -$ &! !&$; ;$!"! /- & /-#/% %!"$-((%!. E!

    $"# (# $ -$(#)%$!* $=$(&"- $+ (#)!*# *$ &! )#*#

    $/$(%+, *$!#)%!*# C#!(&--$!"$ 5 9&$ /$-)%"%-4 $?&%- 

    $=$(&"!*# #"-# (#)!*# %! !$($%** *$ 9&$ $+ /-%)$-# 35

    "$-)%!*#. A +# /-#($# $=$(&"*# *$ $"$ )#*# $ +$

    *$!#)%! "-$ *$ $?&!*# /+!#, *$ *#!*# # "-$ /$*

    .

    3.3 SKEDA DE FICHEROS

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    15/23

    L 9&$* ) 3%"&+ $ 3($ $! &!(%! *$ +

    (-("$-"%( # "-%&"# *$ +# %(3$-# (#)# !#)-$, ")#,

    "%/#, $'"$!%!, $(3 *$ (-$(%!, )#*%%((%!, $"(.. 5 /- $++#

    $ *%/#!$ *$+ (#)!*# FI*D.

    3.3.1 COMA*DO FI*D

    E $+ (#)!*# 4%(# /- + +#(+%(%! *$ %(3$-#. A*$)4

    *$ &(-, (#! $"$ (#)!*# $ /&$*$ /+%(- $+ )%)#

    (#)!*# # /-#?-) *%"%!"# %(3$-#, %! !$($%** *$ &!

    (-%/" (#)/+%(*#.E+ (#)!*# @IND !$($%" /-4)$"-#: - *$ +

    9&$*

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    16/23

    C&!*# $ /-$"$!* &(- $! $+ (#!"$!%*# *$ &! %(3$-#, $!

    +&?- *$ /#- & (-("$-"%(, $ &"%+%- + )%+% *$

    (#)!*# GREP, $! + 9&$ $ $!(&$!"-! $+ /-#/%# ?-$/, $?-$/ 5

    ?-$/. E! $"# (#)!*# $ /&$*$! %!*%(- $'/-$%#!$

    -$?&+-$ /- $/$(%%(- $+ (#!"$!%*# &(-.E+ #-)"# *$ $"# (#)!*# $ $+ %?&%$!"$:

    Crep patrn conunto- de ficheros

    E! $+ /-4)$"-# P"-! $ %!*%( + (#!"!"$ # $'/-$%!

    -$?&+- 9&$ $'/-$ + (*$! *$ "$'"# &(- $! +# %(3$-# 5

    $ *$!#)%! /"-! *$ 9&$*. E+ $?&!*# $ &! %(3$-# #

    (#!=&!"# *$ %(3$-# $'/-$*# /#- )$*%# *$ )$"(-("$-$. S%

    $ *$$ &(- $+ )#*# -$(&-%;# *$ &! 4-#+, $!"#!($ 3-49&$ (#)%!- +# (#)!*# ?-$/ 5 %!*, *$ "+ )#*# 9&$ $

    $=$(&"$ ?-$/ #-$ +# %(3$-# $!(#!"-*# /#- %!*. L #/(%! –

    ; /$-)%"$ #"$!$- +# %(3$-# 9&$ !# %?&$! $+ /"-!.

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    17/23

    3.4 ,ERMISOS 8 SEGRIDAD E+EME*TA+

    E! $+ %"$) *$ %(3$-# +# #=$"%;# 4%(# *$ + $?&-%** #! +

    %!"$?-%** 5 + (#!%*$!(%+%**. L "-$ *$ *)%!%"-(%! #!

    &!*)$!"+$ /- (#!$?&%- $"# #=$"%;#, +# &&-%# ")%!*$$! (#+#-- %?&%$!*# &! (#--$(" /#+"%( *$ /-#"$((%! *$ &

    %(3$-# 5 *%-$("#-%# (#)# &! ?$"%! *$(&* *$ & (+;$ *$

    (($#.

    D$ )#)$!"# /)# *$(-%%- +# )$(!%)# $+$)$!"+$ *$

    /-#"$((%! $! 4ni : +# /$-)%# # *$-$(3# *$ (($#.

    3.4.1 ,ERMISOS DE ACCESO

    12 %" *$ i-nodo  #! +# $!(-?*# *$ ?$"%#!- $+ (($# +#%(3$-#, *$ +# (&+$ #! &"%+%*# !#-)+)$!"$. E# %" $

    ?-&/! $! "-$ ?-&/# (#--$/#!*%$!"$

    "-$ #/$-(%#!$: +$("&-, $(-%"&- 5 $=$(&(%!. E"# /$-)%# +#

    $"+$($ (* &&-%# /- & %(3$-#, /$-# /&$*$ *#%%(- &

    /-#/%# *$-$(3# *$ (($#, +# *$ +# )%$)-# *$ & ?-&/# 5 +# *$+

    -$"#.

    P- )!$=- 5 ;%&+%- $"# %" $ &$+$! &"%+%- $+ (-4("$- r 

    Kread) /- $+ /$-)%# *$ +$("&-, < K

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    18/23

    3.4. COMA*DO CHMOD

    P- ()%- 5 ("&+%- +# /$-)%# *$ &! %(3$-# # (#!=&!"# *$

    %(3$-# $ & $+ (#)!*# chmod( E"$ $ $+ #-)"# *$+ (#)!*#:

    chmod modo fchero

    I!*%( + /-#"$((%! 9&$ $ 9&%$-$ *- + %(3$-# 5 $ /&$*$ $/$(%%(-

    *$ *# )#*#: #+&"# 5 -$+"%;#.

    E+ modo relativo /$-)%"$ *%- # $+%)%!- /$-)%# #-$ +# 5

    $"+$(%*#. S$ &$+$! &- "-$ (-("$-$ /- $"$ )#*#:

    1. P- -$$-%-$ + /-#/%$"-%#, ?-&/# # -$"# $-4 u Kuser)% '

    K'roup) u o Kothers). T)%! $ /&$*$ &- /--$$-%-$ "#*# + ;$.

    2. S$- K /- *%- $+ /$-)%# # – /- $+%)%!-+#.. S$- $+ /-#/%# /$-)%# -$/-$$!"*# /#- $+ (-4("$- r% < #

     (

    E! $+ )#*# #+&"# $ /&$*$! $"+$($- +# %" *$ &! #+

    ;$ /$-# /- $++# $ *$$! $/$(%%(- *%?%"# #("+$ *$

    ;+#-$ $!"-$ 0 5 7. E"$ ;+#- #("+ (#--$/#!*$ +# %" *$

    (* *#)%!%# . Y $ (+(&+(#!;%-"%$!*# + "-$ (%- %!-% $ , # +# 9&$ $ +#

    )%)#, (+(&+!*# $+ -$&+"*# *$ &! &) 9&$ %!(-$)$!"-

    /- %!*%(- +$("&-, 2 /- $(-%"&- 5 1 /- $=$(&(%!.

    P- $'/-$- $! )#*# #+&"# +# ;+#-$ -$/-$$!"*# $! $+

    /-"*# !"$-%#- &-)# $"# (#)!*#:

    chmod 751 pro

    chmod !"# fch

    P- /- *$+ /-%)$-# + $?&!*# *$ )#*# -$+"%;# $ 3- +#

    %?&%$!"$:

    chmod $ % x pro

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    19/23

    S% $ 9&%$-$ $'/!*%- $+ ()%# *$ /$-)%# /#- "#*# +#

    %(3$-# *$+ &4-#+ *$%!%*# /#- &! *%-$("#-%# $ /&$*$ &- +

    #/(%! D(

    chmod !"# d&r

    chmod %R !"# d&r

    C#)!*# find  ($ -$(#-*- 9&$ $ /#*! 3($- 9&$* /#- 

    + %!#-)(%! *$ +# /$-)%# )$*%!"$ $+ /-4)$"-# perm.

    3.4.3 ,ERMISOS ,OR DEFECTO) COMA*DO MAS

    E+ (#)!*# umas:  /$-)%"$ )#*%%(- +# /$-)%# /#- *$$("#. S%!

    $)-?#, & &"%+%(%! /#$$ (%$-" (#)/+$=%**, 5 9&$ !# $ +$ /

    *%-$(")$!"$ (#)# /-4)$"-# $+ (#!=&!"# *$ /$-)%# 9&$ $ *$$

    $"+$($-, %!# &! )4(- $9&%;+$!"$ + (#)/+$)$!"# 7 *$+ ;+#- 

    #+&"# *$ *%(3# (#!=&!"#.

    E! + )4(- !# $ $"+$($! +# /$-)%# %!# + /-#3%%(%#!$.

    U! (#)!*# 3%"&+ $ $+ %?&%$!"$:

    'm$() #*7

    3.4.4 ,ERMISOS E* DIRECTORIOS

    L $)4!"%( *$ +# /$-)%# *$ $=$(&(%! ;-% &! /#(# $! +#

    *%-$("#-%#. C#)# $+ *$-$(3# *$ $=$(&(%! !# "%$!$ $!"%*# $! +#

    *%-$("#-%#, +# %" (#--$/#!*%$!"$ $ &"%+%! /- %!*%(- *$-$(3#

    *$ /# /#- $+ *%-$("#-%# +# %(3$-# # &*%-$("#-%# %!(+&%*# $! $+.

    E+ %?!%%(*# *$+ /$-)%# *$ $(-%"&- ")%! ;-% $! +# *%-$("#-%#,

    5 9&$ $$ *$-$(3# $ -$$-%-4 % $ /&$*$ # !# 3($- 

    )#*%%((%#!$ $! $+ *%-$("#-%# (-$!*#, #--!*# # )#*%%(!*#

    %(3$-#.

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    20/23

    3.4.B ITS ES,ECIA+ES

     A*$)4 *$ +# %" *$ /-#"$((%! 4%(#, $! $+ i nodo -$%*$!

    #"-# %" /- $+ $%(%$!"$ (#!"-#+ *$ +# *$-$(3# *$ (($#. E"#

    "-$ %" *$ +# %"$) U!%', (#!#(%*# /#- setuid% set'id  5 stic:&% #!

    $/$(%+$ 5 +?# (#)/+$=#, /$-# $$!(%+$ /- &! (#--$("

    *)%!%"-(%!.

    3.B ,ARTICIO*ES 8 MO*TA0E

    E! $"$ /-"*# $'/+%(-$)# (#)# $ /#%+$ (#!$?&%-+# (&!*#$ *%/#!$ *$ ;-% &!%**$ /- + &%((%! *$ %(3$-# 5 "$!%$!*#

    $! (&$!" 9&$ +# *%(# /&$*$! "$!$- ;-% /-"%(%#!$.

    3.B.1 ,ARTICIO*ES

    L /-"%(%#!$ #! #! *$+ *%(# *&-# 9&$ #! (#!"$)/+* /#- $+

    %"$) #/$-"%;# (#)# % &$-! *%(# %!*$/$!*%$!"$, ?-(% 9&$

    $! (* /-"%(%! -$%*$ + %!#-)(%! *$ (#!"-#+ 5 *"# &%(%$!"$

    /- ?$"%#!- &! %"$) *$ %(3$-# /-#/%#.

    3.B. COMA*DOS FDIS 8 MFS

    L# (#)!*# 4%(# /- + ?$"%! *$ /-"%(%#!$ #! *# 9 fdis:  5

    m:fs( A)# $ $=$(&"! $! )#*# root 5 *$$! $- &*# (#! )&(3

    /-$(&(%!.

    fdis:  /$-)%"$ (-$- 5 -$*%)$!%#!- /-"%(%#!$. E+ #/$-!*# $-4 $+

    !#)-$ *$+ *%/#%"%;# (#--$/#!*%$!"$, 3%"&+)$!"$ *$+ "%/#

     ;dev;hda /- *%(# IDE 5 ;dev;sda /- *%(# SCSI.

    +d&() ,de,hd$

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    21/23

    E"$ (#)!*# #-$($ ;-% #/(%#!$, $!"-$ + 9&$ *$"(! +

    %?&%$!"$:

    m  %!#-)(%! *$ 5&*

     p  ;%&+%- + /-"%(%#!$

    l   "%/# *$ /-"%(%!

    n  (-$- !&$; /-"%(%!

    d   $+%)%!- &! /-"%(%!

    t ()%- (-("$-"%( *$ &! /-"%(%!

    w   "$-)%!- (#!#+%*!*# +# ()%# -$+%*#

    q   "$-)%!- %! (#!#+%*- +# ()%#

    3.B.3 MO*TA0E

    E+ #=$"%;# 4%(# *$+ )#!"=$ $ $"-&("&-- $! &! !%(# %"$) *$

    %(3$-# $! #-) *$ 4-#+ +# %"$) *$ %(3$-# /$-)!$!"$-$%*$!"$ $! +# #/#-"$ )?!"%(# 5 #"- )$)#-% %!"$-)$*%

    *%-$((%#!+$.

    3.B.4 MO*TA0E ATOMATICO) FICHERO /ETC/FSTA

    P- (#!$?&%- 9&$ $! L%!&' "#* + /-"%(%#!$ *$ +# *%(# *&-#

    /&$*! $- )#!"* 5 #-)$! $+ %"$) *$ %(3$-# )#"-*#!"$-%#-)$!"$, $+ %(3$-#  ;etc;fstab  )!"%$!$ + (#!%?&-(%! *$+

    )#!"=$ %!%(%+.

    3.B.B COMA*DOS MO*T 8 MO*T

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    22/23

    P- $+ )#!"=$ )!&+ *$ *%/#%"%;# # /-"%(%#!$ &-$)# $+

    (#)!*# mount , )%$!"- 9&$ /- /#"$-%#-)$!"$ *$)#"--+#

    -$(&--%-$)# umount .

    L# /-4)$"-# 4%(# /- + #/$-(%! *$ )#!"=$ #! *#: $+

    !#)-$ %)+%(# *$+ *%/#%"%;# # /-"%(%! 5 $+ *%-$("#-%# *#!*$ $

    $!-. A*%(%#!+)$!"$ $ /&$*$ $/$(%%(- $+ "%/# *$ %"$) *$

    %(3$-# /#- )$*%# *$ + #/(%!  t( P#- +# "!"#, $+ #-)"# $-4 $+

    %?&%$!"$:

    mo'./ %/ /&po d&(po(&/&o d&rec/or&o

    E+ (#)!*# mou!" "%$!$ #"- #/(%#!$ %!"$-$!"$ $!"-$ + 9&$*$"(! + %?&%$!"$:

    -r   )#!"=$ *$ #+# +$("&-.

    -o conv Nauto (#!;$-%! &"#)4"%( $!"-$ (-("$-$ $9&%;+$!"$.

    P#- &+"%)#, (&!*# $ 9&%$-$ ()%- &! *%9&$"$ # CD 3-4 9&$

    &"%+%- $+ (#)!*# &)#&!", 9&$ #+# !$($%" (#)# /-4)$"-# $+!#)-$ *$+ *%/#%"%;#.

    umount dispositivo

  • 8/16/2019 Sistema de Ficheros y Comandos Basicos

    23/23