Linux uqa褧@ANbLhHhuҡC ӬFUӨϥΪ̨㦳wzA]ɮתvzNܪܭnFC Linux @Nɮץis觋TOAOO owner/group/otherA BU read/write/execute vCYzoAN|z Linux DܪwC t~AzpGIJ Linux ܡAA b Linux Uohؿ/ɮסA쩳NNqOH Uڭ̴NӤ@@ЩOI |
[root@linux ~]# ls -al total 248 drwxr-x--- 9 root root 4096 Jul 11 14:58 . drwxr-xr-x 24 root root 4096 Jul 9 17:25 .. -rw------- 1 root root 1491 Jun 25 08:53 anaconda-ks.cfg -rw------- 1 root root 13823 Jul 10 23:12 .bash_history -rw-r--r-- 1 root root 24 Dec 4 2004 .bash_logout -rw-r--r-- 1 root root 191 Dec 4 2004 .bash_profile -rw-r--r-- 1 root root 395 Jul 4 11:45 .bashrc -rw-r--r-- 1 root root 100 Dec 4 2004 .cshrc drwx------ 3 root root 4096 Jun 25 08:35 .ssh -rw-r--r-- 1 root root 68495 Jun 25 08:53 install.log -rw-r--r-- 1 root root 5976 Jun 25 08:53 install.log.syslog [ 1 ][ 2 ][ 3 ][ 4 ][ 5 ][ 6 ][ 7 ] [ ݩ ][s][֦][s][ɮeq][ ק ][ ɦW ] |
[-][rwx][r-x][r--] 1 234 567 890 1 GNoɦWؿɮס]Wɮס^ 234G֦Hv]WiŪBigBi^ 567GPsըϥΪv]WiŪi^ 890GLϥΪv]WȥiŪ^
drwx------ 3 root root 4096 Jun 25 08:35 .ssh |
drwxr--r-- 3 root root 4096 Jun 25 08:35 .ssh |
D@GpGUɮסAлɮת֦̻PvH
-rw-r--r-- 1 root root 238 Jun 18 17:22 test.txt -rwxr-xr-- 1 test1 testgroup 5238 Jun 19 10:25 ping_tsaiG
|
DGGpGڪؿU˦Aа testgroup oӸsժPLH( others )O_iHiJؿH
drwxr-xr-- 1 test1 testgroup 5238 Jun 19 10:25 groups/G
|
[root@linux ~]# chgrp [-R] dirname/filename ... ѼơG -R : i滼j( recursive )ܧAYsPؿUҦɮסBؿ soӸsդNC``ΦbܧY@ؿpC dҡG [root@linux ~]# chgrp users install.log [root@linux ~]# ls -l -rw-r--r-- 1 root users 68495 Jun 25 08:53 install.log [root@linux ~]# chgrp testing install.log chgrp: invalid group name `testing' <== oͿ~To䤣oӸsզW |
[root@linux ~]# chown [-R] bW ɮשΥؿ [root@linux ~]# chown [-R] bW:sզW ɮשΥؿ ѼơG -R : i滼j( recursive )ܧAYsPؿUҦɮסBؿ soӸsդNC``ΦbܧY@ؿpC dҡG [root@linux ~]# chown bin install.log [root@linux ~]# ls -l -rw-r--r-- 1 bin users 68495 Jun 25 08:53 install.log [root@linux ~]# chown root:root install.log [root@linux ~]# ls -l -rw-r--r-- 1 root root 68495 Jun 25 08:53 install.log |
[root@linux ~]# cp ӷɮ تɮ
|
[root@linux ~]# cp .bashrc .bashrc_test [root@linux ~]# ls -al .bashrc* -rw-r--r-- 1 root root 395 Jul 4 11:45 .bashrc -rw-r--r-- 1 root root 395 Jul 13 11:31 .bashrc_test |
[root@linux ~]# chmod [-R] xyz ɮשΥؿ ѼơG xyz : NO责쪺ƦrvݩʡA rwx ݩʼƭȪۥ[C -R : i滼j( recursive )ܧAYsPؿUҦɮסBؿ soӸsդNC``ΦbܧY@ؿpC |
[root@linux ~]# ls -al .bashrc -rw-r--r-- 1 root root 395 Jul 4 11:45 .bashrc [root@linux ~]# chmod 777 .bashrc [root@linux ~]# ls -al .bashrc -rwxrwxrwx 1 root root 395 Jul 4 11:45 .bashrc |
DTGNz .bashrc oɮתݩʧ^Ӫ -rw-r--r-- G
|
chmod | u g o a |
+([J) -(h) =(]w) |
r w x | ɮשΥؿ |
[root@linux ~]# chmod u=rwx,go=rx .bashrc # `NI u=rwx,go=rx Osb@_AèSťզrI [root@linux ~]# ls -al .bashrc -rwxr-xr-x 1 root root 395 Jul 4 11:45 .bashrc |
[root@linux ~]# ls -al .bashrc -rwxr-xr-x 1 root root 395 Jul 4 11:45 .bashrc [root@linux ~]# chmod a+w .bashrc [root@linux ~]# ls -al .bashrc -rwxrwxrwx 1 root root 395 Jul 4 11:45 .bashrc |
[root@linux ~]# chmod a-x .bashrc [root@linux ~]# ls -al .bashrc -rw-rw-rw- 1 root root 395 Jul 4 11:45 .bashrc |
[root@linux ~]# cd /tmp [root@linux tmp]# mkdir testing [root@linux tmp]# chmod 744 testing [root@linux tmp]# touch testing/testing [root@linux tmp]# chmod 600 testing/testing # o mkdir ObإߥؿΪOIO make directory YgC # ڭ̥ root b /tmp Uإߤ@ӦW testing ؿA # åBNӥؿvܬ 744 Aӥؿ֦̬ root I # t~A touch iHΨӫإߤ@ӨSeɮסA]A touch testing/testing # iHإߤ@ӪŪ /tmp/testing/testing ɮ׳I [root@linux tmp]# ls -al drwxr--r-- 2 root root 4096 Jul 14 01:05 testing # JӬݤ@UAؿvO 744 ABݸsջPϥΪ̧O root I # UӡAڭ̱N root @먭ϥΪ̡C # tθ̭ dmtsai @먭ϥΪ̱bAҥH dmtsai [root@linux tmp]# su dmtsai # su OOΨӡyܴz@ӫOAڭ̥ӷ|ԲӤСC # `NݡAUo@椤Ao{ϥΪܬ dmtsai FAӥBܦrܦ $ FI # ]NOA{bާ@tΪHܦ dmtsai FI dmtsai oӤH # /tmp/testing Oݩ others vALiH /tmp/testing FH [dmtsai@linux tmp]$ ls -l testing <== ɨ dmtsai total 0 ?--------- ? ? ? ? ? testing # iHd\̭TI]dmtsai 㦳 r vALAvA # ܦhƳMOݸ (?) ӪǩǪ [dmtsai@linux tmp]$ cd testing <== ɨ dmtsai bash: cd: testing/: Permission denied # o{FܡHYϧڭ̨㦳 r vAOS x AҥH # dmtsai LkiJ /tmp/testing I [dmtsai@linux tmp]$ exit [root@linux tmp]# chown dmtsai testing # ϥ exit NiH} su \FCڭ̱No testing ؿ֦̳]w # dmtsai A dmtsai N owner FAoӨϥΪ̤SF©OH [root@linux tmp]# su dmtsai [dmtsai@linux tmp]$ cd testing <== ɨ dmtsai [dmtsai@linux testing]$ ls -l <== ɨ dmtsai -rw------- 1 root root 0 Jul 14 01:13 testing # A dmtsai AɴNiJ testing FId\@UeC # o{F testing oɮצsbIvOu root ~s # ڭ̴դ@U_ROH [dmtsai@linux testing]$ rm testing <== ɨ dmtsai rm: remove write-protected regular empty file `testing'? y # MiHRIo˲zѤFܡHI |
[root@linux ~]# ls -l /
drwxr-xr-x 2 root root 4096 Jul 14 05:22 bin
drwxr-xr-x 3 root root 4096 Jul 9 05:18 boot
drwxr-xr-x 9 root root 4880 Jul 11 00:45 dev
drwxr-xr-x 6 root root 4096 Jun 29 01:06 disk1
drwxr-xr-x 3 root root 4096 Jun 25 08:53 disk2
drwxr-xr-x 83 root root 12288 Jul 14 05:23 etc
drwxr-xr-x 6 root root 4096 May 30 20:07 home
drwxr-xr-x 10 root root 4096 Jul 14 05:23 lib
drwx------ 2 root root 16384 Jun 25 16:21 lost+found
drwxr-xr-x 3 root root 4096 Jun 25 19:34 media
drwxr-xr-x 2 root root 4096 Apr 25 23:54 misc
drwxr-xr-x 2 root root 4096 May 23 12:28 mnt
drwxr-xr-x 2 root root 4096 May 23 12:28 opt
dr-xr-xr-x 59 root root 0 Jul 10 01:25 proc
drwx------ 9 root root 4096 Jul 13 11:31 root
drwxr-xr-x 2 root root 4096 Jul 14 05:22 sbin
drwxr-xr-x 2 root root 4096 Jun 25 08:23 selinux
drwxr-xr-x 2 root root 4096 May 23 12:28 srv
drwxr-xr-x 10 root root 0 Jul 10 01:25 sys
drwxr-xr-x 10 root root 4096 Jun 25 20:24 system
drwxrwxrwt 10 root root 4096 Jul 14 05:23 tmp
drwxr-xr-x 14 root root 4096 Jun 25 08:27 usr
drwxr-xr-x 24 root root 4096 Jun 25 20:16 var
|
ؿ | mɮפe |
/ | ڥؿ root (/)A@ijbڥؿUuؿAnɮצb / UC ڥؿO}ɭԨtβĤ@ӱ partition AҥHAҦ}L{|Ψ쪺ɮסA ӳnmbo partition C|ҨӻA /etc, /bin, /dev, /lib, /sbin oӦؿӭnPڥؿsb@_AiWߦY partition OI |
/bin, /usr/bin, /usr/local/bin | F /bin ~A /usr/local/bin, /usr/bin ]OmyϥΪ̥i檺 binary file ؿzI|ҨӻA ls, mv, rm, mkdir, rmdir, gzip, tar, cat, cp, mount nOboӥؿC |
/boot | oӥؿDnتOm Linux tζ}|Ψ쪺ɮסC }|Ψ줰OHSNO Linux ֤ɮסCoӥؿUɦW vmlinuz NO Linux Kernel աInFI ӦpGA}z{ (loader) grub ܡAoӥؿ٦ /boot/grub oӦؿI |
/dev | b Linux tΤWA˸mPP]ƳOHɮתAsboӥؿC zunzLsoӥؿUYɮסANsYӸ˸mo DnSP] (character device)AҦpLBƹFHxs] (block device)A ҦpwСBеCbؿUɮ|hXݩʡAOO major device number A P minor device number Cڭ̪tή֤ߴNOzLo number ӧP_˸mOI nnɮצ /dev/null, /dev/tty[1-6], /dev/ttyS*, /dev/lp*, /dev/hd*, /dev/sd* |
/etc | tΥDn]wɴXGmboӥؿAҦpHbKXɡB
UتAȪҩlɵC@ӻAoӥؿUUɮݩʬOiH@ϥΪ̬d\A
Ou root vOקCåBbؿUɮ״XGO ASCII ¤rɮC
LA FHS ijnmiɦboӥؿCnɮצG
/etc/inittab, /etc/init.d/, /etc/modprobe.conf,
/etc/X11, /etc/fstab, /etc/sysconfig/ Ct~AUnؿG
|
/home | oOtιw]ϥΪ̮aؿ (home directory)CbAsW@Ӥ@ϥΪ̱bɡA
w]ϥΪ̮aؿ|WdǫӡCnOAaؿإNG ~GNثeoӨϥΪ̪aؿA ~dmtsai GhN dmtsai aؿI |
/lib, /usr/lib, /usr/local/lib | tη|ϥΨ쪺祃wmؿC {bB@L{Ai|Is@B~\ѼơAݭn祃wUI oǨ祃wNbBCnO /lib/modules oӥؿ|\ kernel ҲճI |
/lost+found | tΤ`Ϳ~ɡA|N@ǿqmؿUA q`oӥؿ|۰ʥX{bY partition ̳hؿUCҦpA[ˤ@ʵwЩ /disk A boӥؿUN|۰ʲͤ@ӳo˪ؿ /disk/lost+found |
/mnt /media | oOnлPйw]IaFq`nбb /mnt/floppy UAӥбb /mnt/cdrom UAL]@wաIunAAHK@Ӧaӱ]iHrIt~Aثe]WXt@ /media ؿOIP /mnt Iա |
/opt | oODB~w˳n\ؿC|ҨӻA FC4 ϥΪO Fedora s}onA pGzѷQnۦw˷s KDE ୱn骺ܡAiHNӳnw˦boӥؿUNC LAHe Linux tΤAڭ٬OߺDmb /usr/local ؿUOI |
/proc | oӥؿO@ӡyɮרtΡzILmƳObOA Ҧptή֤ߡBΦTBP]ƪAκAC]oӥؿUƳObOA ҥHwЪŶڡInɮרҦpG/proc/cpuinfo, /proc/dma, /proc/interrupts, /proc/ioports, /proc/net/* C |
/root | tκz (root) aؿCҥHbo̡A O]ڭ̴LAtβĤ@Ӷ}NQ partition / A ӧڭ̧Ʊ /root P / bP@ partition WGC |
/sbin, /usr/sbin, /usr/local/sbin | m@Ǩtκz~|ʥΨ쪺OAҦpG fdisk, mke2fs, fsck, mkswap, mount CP /bin Ӥ@˪aAoXӥؿO root tκzΪCOؿU٬OiH@ϥΪ̥ΨӡyݡzӤ]wI |
/srv | @ǪAȱҰʤAoǪAȩһݭnΪƥؿC|ҨӻAWWW AݭnƴNiHmb /srv/www ̭C |
/tmp | oO@ϥΪ̩Ϊ̬Ob檺{ǼȮɩmɮתaC oӥؿOHsAҥHzݭnwMz@UCMAnƤimbؿڡI |
/usr | FHS WdĤGheAb /usr ؿUA]ttΪDn{B
ϧΤһݭnɮסBB~祃wBݩҦۦw˪nAHΦ@ɪؿPA
iHboӥؿo{CƹWALIO Windows @~tηyProgram fileszP
yWinNTzoӥؿXIbؿUnؿG
|
/var | oӥؿ]ܭnA]O FHS WdĤGhؿeCLDnmOwtΰL{A
`AܰʪɮשmؿC|ҨӻAҦp֨ɮ (cache) Ϊ̬OHܧn
(log file) OboӥؿC~AYdznL{|gJƮwɮסA
Ҧp MySQL ƮwA]gJboӥؿIܭnaILUnؿG
|
yAQnq ext 2ഫ ext3 OH|ӥDnzѡGiQΩʡBƧʡBtפΩഫz
yiQΩʡzALXAoN۱qtΤֳts_ӤO e2fsck ɶ״_Cext3
xiHקKƷliCL]XG
yFgJYzƶWL@ɡAext3 |֩ ext2A] ext3 xϵwŪYʯĪiz
Mөγ\Mw]٬ObJohnsonͪĥ|ӲzѤC yOiHq ext2 ܧ ext3 o@ӱjӦOxɮרtΦӤݭns榡ơzCyOTAF@U ext3 nBOݭnh@تɶAFBͿ~ƥu@έs榡ƪʧ@zC |