chapter06

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Slide 1: 

2009?2?7?4?7? 1 ??? ?????? ??? E-mail:[email protected] ??????:http://turbolinux.ys168.com QQ: 951482750

?????????? : 

?????????? ??:????????????,?????(???)????????(??,??,???)?????????? ?????,??????????,??????????????????(inode)???,??????????????? ???:??????,???,??,???,????? ???:?????????,?????????????,???.?? ????:????????????,?????

???????? : 

???????? ?????????????????(???????????? ?????????????????,??????? ???????????,???????????? Linux????????ext2,???????????????????ext3. Linux?????????????,?/dev/cdrom

???? : 

???? ????(?????????) ????:ASCII????? ?????:?????????????,?????,??????????? ???? ????(?UNIX???????????????,?????????) ????? ??????

6.1 ???? : 

6.1 ???? ??????? ??????????????: ???????inodes ??????inode????? ???????inode????? ??inode??: ????,????,?????? ????, ??,?,???. ??????????? ???????????inode???.

6.2 ?????? : 

6.2 ?????? ?????????????????. ???????????. ????????????.

?? : 

?? ?????? ?????????????????,?????(root),???????,???????????,?????????

??????? : 

??????? ?????????????? ???????????????? ??????????????? ????????? ???????????????

6.2.2 ??????? : 

6.2.2 ??????? ?????? The /etc ????????? The /var ???????????,?????,??????.

6.2.3 ??? : 

6.2.3 ??? ?????????/???????ASCII??,Linux?????????,?????????,?????????? ???file???????????????? ???type??????????????

?????? : 

?????? Filenames ???????????? “-” ??????? ?, *, (, ), &, [, ], >, <,??, tab ????ASCII??

6.2.4 ??? : 

6.2.4 ??? ??:??????????????? ????:??(/)?????? ?pwd ???? /home/jhf/test ????:??????????????? ?: cd ../../../lib/modules ??/lib/modules??? ???????/??,????????? .????? ..???? ?????HOME:?????????????,????????????????? ??????cd ~?cd??????????

Slide 13: 

???

Slide 14: 

Home ?? ??????????? ????????/etc/skel/???????? ???.bash_profile?.bashrc??????,?????????????

??????? : 

??????? Path Names Simple Directory Commands cd directory ??directory?? cd ??????? pwd ???????? ls ?????????? ls -l ????????

ls : 

ls #ls [??][?????] -a ???????????????,?????? -i ????????i-node??? -l ????? -F ???????/,????????*,[email protected],?????|,socket???= -s ??????????? --color ???? -d ????? -R ????????? -t ?????

ls : 

ls -d?????????????????: # ls -d my* ????????????“my”?????? -R ??????????????

?????? : 

??????

5.2 Linux???? : 

5.2 Linux???? #ls -al ???? ??? ????? ?????? ???? ?????????? ???

Slide 20: 

????cp cp [??] ??? ????---------copy???????? cp [??] ??? … ??? ?? -----copy??????????? ?????????????????? ??: -i ??? -f ???? -r ???(???????) -dpR ????????? ?????? man cp

Slide 21: 

???????? mv [??] ??? ?? [??] -i ????? -r ???? -f ???? ?? #mv file /tmp /example #mv –rf /test /tmp #mv /usr/xu/* .

Slide 22: 

???? rm rm [-ir] ??1 ??2… -r ?? -i ??? ????????????,?????rmdir $rm file1 file2 $rm –rf dir1

Slide 23: 

???? ? mkdir ????,? rmdir????. ???????????????? # rm -r ?? ?????? # cp -r ??? ???

?????? : 

?????? cat ???????????? tac ????????? more ??????????? less ?more??,??????? head ????? tail ??????

Slide 25: 

cat :????????,????????????????????,?????? # cat /etc/passwd /root/install.log # cat /etc/passwd tac: ?cat?? ????,????????

more : 

more ?? # more ??? ??: #more ~/.bashrc ??????????? # ls -al |more ??????ls???????

less : 

less ?? # less ??? ??: #less ~/.bashrc ????????,????/string??????string????

head : 

head ?????????? ?? #head ~/.bashrc #head -n 20 ~/.bashrc ?????10?

tail : 

tail ?????????? ?? #tail ~/.bashrc #tail -n 20 ~/.bashrc ?????10? ??:??~/.bashrc ??11-20?? #head –n 20 ~/.bashrc | tail –n 10

file?? : 

file?? ?? [test @test test]$ file [???] ?? [test @test test]$ file ~/.bashrc [test @test test]$ file /usr/bin/passwd ??:????????

wc?? : 

wc?? ?? [test @test test]$ wc [???] ?? [test @test test]$ wc -w /etc/passwd [test @test test]$ wc -c /etc/passwd [test @test test]$ wc -l /etc/passwd ??:??????????????

??????? : 

??????? ???inode block????????????,inode ??????????????block???? ????????????????,????????inode table????????,????????????????????block?,????????????

ln : 

ln ??? ?????inode????????block?,??????????????????? ?? ???????? ?????? ?? [root @test root] # mkdir test [root @test root] # cd test [root @test root]# cp /usr/bin/passwd . [root @test root]# ll [root @test root]# ln passwd passwd-hard [root @test root]# ll

???? : 

???? ??:?????????,?????,??????????? ?? ln [ -s ] [ ??? ] [ ???? ] ?? [root @test root] # cd test [root @test root]# cp /usr/bin/passwd . [root @test root]# ll [root @test root]# ln passwd passwd-soft [root @test root]# ll

??????? : 

??????? ?ls?????? -i ??????????? -lL ????????????? ?? [root @test root] # touch file1 [root @test root]# ln file1 file2 [root @test root]# ln -s file1 file3 [root @test root]# ln -il file[1-3] [root @test root]# ls -ilL file3

Slide 36: 

rm??????????;???????????????,?????????????,linux???????? mv?????,??????????;??????????????

6.2.5 ??????? : 

6.2.5 ??????? ??????? ????????????????????????. ????id?????????????. ?????????????????. /etc/passwd ? /etc/group ????????????????. /etc/passwd??????,??????????????/etc/shadow???,??/etc/shadow?????suid????

File Hierarchical System : 

File Hierarchical System ??????? ?????? ?????????????????????????. ???????????????,??????,??????????????? ??????????????? ??:?cp?????????,?????????cp???????? ??:mv?ln???????????,?????????

File Hierarchical System : 

File Hierarchical System ??????? ???? ??????????????: user, group, and other. ???????,??????????: ??????. ???????????9?????,??????????9???????.???

Slide 40: 

— r w x r w — r — — ???????? ????????? ?????????? ???? ?? ?? ??? ??—,????? d ??d,????? l ??l,??????? b ??b,?????????????????? c ??c,???????????????,????????

File Hierarchical System : 

File Hierarchical System ??????? ???? ??

??????? : 

??????? ????? ???????????????????????. ????????. ???????????????,????????? ?????????????????????????????.

Slide 43: 

Users, Groups, and Files Protection:  Files

Slide 44: 

??:  ?? ???????????,???????????????. ?????????????????????. ??????????????????,????????????. ????????????,???????,??????,????????,????????????????????? ????????????????(???????),????????,???????? r ????????,???????? rx ???????????

Slide 45: 

Users, Groups, and Files ????????? ???????: chown user files... ????: chgrp group files... ????????? chmod mode files... ???????-R?????????????? ????????root???????

Slide 46: 

??????? ??????? ??“=+-”???. =???? + ???? - ???? u, g ,o,a ??????? u???;g??;o???;a????????(ugo) r, w, x ?????? r ?read; w?write; x-execute

Slide 47: 

????chmod ?????????? r :4 w:2 x:1 chown [ - R ] xyz ????? #chmod 755 .bashrc ?????????? chmod u +(??) r ????? g -(??) w o =(??) x a

File Hierarchical System : 

File Hierarchical System ??????? ??: chmod –R +x ??????????,????????? chmod g+rw ?????????? chmod ug-w ?????????? chmod og=rx ????????????(????????,????????) chmod ug+x,o-rwx ???????????,??????????

File Hierarchical System : 

File Hierarchical System Users, Groups, and Files ??????–??? ???????????????????????????,4?????,2?????,1?????? Rwx rwx rwx 421 421 421 7 7 7 ?:chmod 755 file1 ????rwxr-xr-x chmod 600 file1 ????rw-------

Files and Directories : 

Files and Directories ???? ???????? ??????,?????? --x ??????????????x?? -wx ???????????????wx?? ???????,?????? --x ??????????????x?? r-- ???????? ???????,?????? --x ????????x?? -w- ????w??

Slide 51: 

Sticky bit——t?? ??Sticky bit?????,????????????????root?????? ??: [test @test test]$ ls -l / 1.?root????,????/tmp?; 2.touch test,????test???777; 3.?????????,???/tmp; 4.????test??;

Slide 52: 

Users, Groups, and Files ???? ????????,?????????????. ????????????,rm,mv,ln???????,-f??????????,?????????????? ???????,??????,??rm –rf??????

6.3 ???? : 

6.3 ???? ?????windows???? UNIX ???????? ??????????. ???????????????? ????????major (???)?minor(???)? ?????????,??????? ????chunk??????? ?????????????????

6.3.1 ???? : 

6.3.1 ???? ???? /dev?????????????????? ?????????????????(RAW) /dev????????????,?????????? /dev??????????????????

???? : 

???? ???? ???? ,?c??????? ??????????. ????????: ??terminal ???Printers ?????Modems ??Magnetic tapes

???? : 

???? ???? ??? ????????(block). ??block???????,????????????????trunk(?) ????????????????????? ???????????????,????mkfs/tunee2fs???dumpe2fs/tune2fs -l

???? : 

???? ???? ??????? /dev/null ??? /dev/tty ????????? /dev/console ????????? /dev/ttynn ??????? /dev/ttyxnn ?????(x????a,b?) /dev/ptsnn X Windows???????? /dev/fd0 ?? /dev/stn /dev/stx ??? /dev/hdx IDE?? /dev/sdx SCSI?? /dev/cdrom CD-ROM /dev/lp0 ?????? /dev/ttySnn ??

???? : 

???? ?????? ??,??????????????????,?????????????mknod???,????????????,?????????root ,?????????

???? : 

???? /proc ?????? ?????????????? ????????????? ???????????? ?????????PID???? ???????????;?/etc/sys/kernel/shmmax ?????sysctl??????,sysctl –w kernel.shmmax=value ???/etc/sysctl.conf?????? /proc/interrupts IRQ?? /proc/ioports I/O?? /proc/cpuinfo CPU?? /proc/dma DMA?? /proc/scsi SCSI???? /porc/ide IDE???? /proc/net ???? /porc/sys ??????

linux ?????? : 

linux ?????? Ext2 linux???????? Ext3 linux??????????? Jfs ibm ?????? Reiserfs ?????? Minix linux?????????? Fat/fat32 windows???? RAID linux?RAID???? Smb ??????,?windows?smb???? Nfs ??????,?unix?? Raw ??? Lvm ?????????? ??????????

File Systems : 

File Systems ??????? mkfs ??????????????? ????????inode?? ?????????,???????????????,????????????

File Systems : 

File Systems ?????? ?linux?????,???????mount???????????? Mount?: mount???????. Mount /dev/hda1 /opt Mount /dev/cdrom /mnt/cdrom umount ??mount ?

File Systems : 

File Systems ???????? /etc/fstab ?????????? ?????????mount?????????????,??nfs???????????????? /etc/fstab???:/dev/hda5 / ext3 defaults 1 1 ??????:?????mount?????????mount ???????(days)?fsckorder

File Systems : 

File Systems ?????? df ??(disk free)?????? The -k ?k??????. The -m ?M??????

File Systems : 

File Systems ??????? du ?? (disk usage) ?????????? ???????? The -a ?????? The -s ?????????? The quota ????????????????

authorStream Live Help