LinuxÖ¸Áchmod
Ö¸ÁîÃû³Æ : chmod
ʹÓÃȨÏÞ : ËùÓÐʹÓÃÕß
ʹÓ÷½Ê½ : chmod [-cfvR] [--help] [--version] mode file...
˵Ã÷ : Linux/Unix µÄµµ°¸µ÷ÓÃȨÏÞ·ÖΪÈý¼¶ : µµ°¸ÓµÓÐÕß¡¢Èº×é¡¢ÆäËû¡£ÀûÓà chmod ¿ÉÒÔ½åÒÔ¿ØÖƵµ°¸ÈçºÎ±»ËûÈËËùµ÷Óá£
²ÎÊý :
mode : ȨÏÞÉ趨×Ö´®£¬¸ñʽÈçÏ : [ugoa...][[+-=][rwxX]...][,...]£¬ÆäÖÐ
u ±íʾ¸Ãµµ°¸µÄÓµÓÐÕߣ¬g ±íʾÓë¸Ãµµ°¸µÄÓµÓÐÕßÊôÓÚͬһ¸öȺÌå(group)Õߣ¬o ±íʾÆäËûÒÔÍâµÄÈË£¬a ±íʾÕâÈýÕß½ÔÊÇ¡£
+ ±íʾÔö¼ÓȨÏÞ¡¢- ±íʾȡÏûȨÏÞ¡¢= ±íʾΨһÉ趨ȨÏÞ¡£
r ±íʾ¿É¶ÁÈ¡£¬w ±íʾ¿ÉдÈ룬x ±íʾ¿ÉÖ´ÐУ¬X ±íʾֻÓе±¸Ãµµ°¸ÊǸö×ÓĿ¼»òÕ߸õµ°¸ÒѾ±»É趨¹ýΪ¿ÉÖ´ÐС£
-c : Èô¸Ãµµ°¸È¨ÏÞȷʵÒѾ¸ü¸Ä£¬²ÅÏÔʾÆä¸ü¸Ä¶¯×÷
-f : Èô¸Ãµµ°¸È¨ÏÞÎÞ·¨±»¸ü¸ÄÒ²²»ÒªÏÔʾ´íÎóѶϢ
-v : ÏÔʾȨÏÞ±ä¸üµÄÏêϸ×ÊÁÏ
-R : ¶ÔĿǰĿ¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼½øÐÐÏàͬµÄȨÏÞ±ä¸ü(¼´ÒԵݻصķ½Ê½Öð¸ö±ä¸ü)
--help : ÏÔʾ¸¨Öú˵Ã÷
--version : ÏÔʾ°æ±¾
·¶Àý :½«µµ°¸ file1.txt ÉèΪËùÓÐÈ˽ԿɶÁÈ¡ :
chmod ugo+r file1.txt
½«µµ°¸ file1.txt ÉèΪËùÓÐÈ˽ԿɶÁÈ¡ :
chmod a+r file1.txt
½«µµ°¸ file1.txt Óë file2.txt ÉèΪ¸Ãµµ°¸ÓµÓÐÕߣ¬ÓëÆäËùÊôͬһ¸öȺÌåÕß¿ÉдÈ룬µ«ÆäËûÒÔÍâµÄÈËÔò²»¿ÉдÈë :
chmod ug+w,o-w file1.txt file2.txt
½« ex1.py É趨ΪֻÓиõµ°¸ÓµÓÐÕß¿ÉÒÔÖ´ÐÐ:
chmod u+x ex1.py
½«Ä¿Ç°Ä¿Â¼ÏµÄËùÓеµ°¸Óë×ÓĿ¼½ÔÉèΪÈκÎÈ˿ɶÁÈ¡ :
chmod -R a+r *
´ËÍâchmodÒ²¿ÉÒÔÓÃÊý×ÖÀ´±íʾȨÏÞÈç chmod 777 file
Ó﷨Ϊ£ºchmod abc file
ÆäÖÐa,b,c¸÷Ϊһ¸öÊý×Ö£¬·Ö±ð±íʾUser¡¢Group¡¢¼°OtherµÄȨÏÞ¡£
r=4£¬w=2£¬x=1
ÈôÒªrwxÊôÐÔÔò4+2+1=7£»
ÈôÒªrw-ÊôÐÔÔò4+2=6£»
ÈôÒªr-xÊôÐÔÔò4+1=7¡£
·¶Àý£º
chmod a=rwx file
ºÍ
chmod 777 file
Ч¹ûÏàͬ
chmod ug=rwx,o=x file
ºÍ
chmod 771 file
Ч¹ûÏàͬ
ÈôÓÃchmod 4755 filename¿Éʹ´Ë³ÌÐò¾ßÓÐrootµÄȨÏÞ
Ïà¹ØÎĵµ£º
ÓÉÓÚ Linux Á¼ºÃµÄÓû§È¨ÏÞ¹ÜÀíÌåϵ£¬²¡¶¾ÍùÍùÊÇ Linux ϵͳ¹ÜÀíÔ±×îºó²ÅÐèÒª¿¼ÂǵÄÎÊÌâ¡£ÒÔÍù£¬Linux ÉϵÄɱ¶¾Èí¼þÖ÷ÒªÊÇΪÆóÒµµÄÓʼþºÍÎļþ·þÎñÆ÷ËùÉè¼ÆµÄ¡£Èç½ñ£¬Ëæ×Å Linux ×ÀÃæÓû§ÊýÁ¿µÄÔö³¤£¬×ÀÃæÓû§ÔÚÊÜÒæÓÚ Linux ϵͳ¶Ô²¡¶¾½ÏÇ¿µÄÌìÈ»ÃâÒßÁ¦µÄͬʱ£¬Ò²ÐèҪɱ¶¾Èí¼þÇåÀí´ÓÍøÂç»òUÅÌ´øÀ´µÄWIndows²¡¶¾¡£¾¡¹ÜÄÇЩ ......
½â¾ö²½Ö裺
gylu@dell-desktop:~$ sudo apt-get install ckermit
ÏÔʾ°²×°¹ý³Ì
gylu@dell-desktop:~$gedit ~/.kermrc
ÊäÈëÏÂÃæÄÚÈݺ󱣴æ.kermrcÍ˳ö:
set line /dev/ttyS0
set speed & ......
viÓëvimÒ»Ñù¶¼ÊDZà¼Æ÷£¬²»Í¬µÄÊÇvim¸ü¸ß¼¶Ò»Ð©£¬¿ÉÒÔÀí½âÊÇviµÄ¸ß¼¶°æ±¾¡£vi¾ÍÏñWindowsÖеļÆʱ¾£¬¶øvimÔò¿ÉÒÔËãµÄÉÏÊÇ
officeÖеÄword¡£viÖ÷ÒªÓÃÀ´±à¼Ò»Ð©Îļþ£¬vimÊdzÌÐòÔ±µÄºÃ¹¤¾ß¡£ºÃµÄ¡£¡£¡£¡£ÏÂÃæÔÚ½éÉÜÒ»ÏÂviµÄʹÓᣡ£¡£¡£¡£¡£
1.
ʹÓÃvi½øÈëÒ»°ãģʽ
[root@linux ~]# vi test.tx ......
ÔÚ±¾½Ì³ÌÖУ¬ÎÒÃǽ«¸øÄú½éÉÜ bash£¨±ê×¼µÄ Linux shell£©£¬ÎªÄúչʾÈçºÎ³ä·ÖÀûÓÃÈç ls¡¢cp ºÍ mv ÕâÑùµÄ±ê×¼ Linux ÃüÁ²¢ÏòÄú½²½â Linux µÄȨÏÞºÍËùÓÐȨģÐÍÒÔ¼°¸ü·á¸»µÄÄÚÈÝ¡£ÔÚ±¾½Ì³Ì½áÊøÖ®¼Ê£¬Äú½«¾ßÓÐ Linux »ù´¡ÖªÊ¶·½ÃæµÄÔúʵ»ù´¡£¬ÉõÖÁ»¹¿ÉÒÔ×¼±¸¿ªÊ¼Ñ§Ï°Ò»Ð©»ù±¾µÄ Linux ϵͳ¹ÜÀíÈÎÎñ·½ÃæµÄ֪ʶ¡£
Ò»¡£¹ØÓÚ±¾½ ......