linuxÖ»¶ÁÎļþÔõôÐÞ¸Ä
ÐÞ¸Ä linux ÖÐÖ»¶ÁÎļþµÄ°ì·¨ÈçÏ£º»ñµÃ root ȨÏÞ£ºsudo suÆôÓÃдȨÏÞ£ºchmod +w ±à¼Îļþ£ºnano £¨¿ÉÑ¡£©½ûÓÃдȨÏÞ£ºchmod -w £¨¿ÉÑ¡£©ÉúÑĵ½ÐÂÎļþ£ºcp
ÐÞ¸Ä Linux ÖÐÖ»¶ÁÎļþµÄ°ì·¨
ÔÚ Linux ϵͳÖУ¬Ä¬ÈÏÇéÐÎÏÂijЩÎļþºÍĿ¼ÊÇÖ»¶ÁµÄ£¬ÕâÒâζ×ÅÄúÎÞ·¨Ö±½Ó¸ü¸ÄËüÃǵÄÄÚÈÝ¡£È»¶ø£¬¿ÉÒÔͨ¹ýÒÔÏ°취ÐÞ¸ÄÖ»¶ÁÎļþ»ò½«ÆäÄÚÈÝÉúÑĵ½ÐÂÎļþ£º
1. »ñµÃ root ȨÏÞ
ΪÁËÐÞ¸ÄÖ»¶ÁÎļþ£¬ÄúÐèÒª¾ßÓÐ root ȨÏÞ¡£Îª´Ë£¬Äú¿ÉÒÔÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ
sudo su
µÇ¼ºó¸´ÖÆ
2. ÆôÓÃдȨÏÞ
ÏÖÔÚ£¬Äú¿ÉÒÔʹÓà chmod ÏÂÁîΪÎļþÆôÓÃдȨÏÞ¡£Óï·¨ÈçÏ£º
chmod +w
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪΪÃûΪ my_file.txt µÄÎļþÆôÓÃдȨÏÞ£¬ÇëÔËÐУº
chmod +w my_file.txt
µÇ¼ºó¸´ÖÆ
3. ±à¼Îļþ
ÏÖÔÚÄúÒѾΪÎļþÆôÓÃÁËдȨÏÞ£¬Äú¿ÉÒÔʹÓÃÎı¾±à¼Æ÷£¨ÀýÈç Nano »ò Vim£©±à¼ÆäÄÚÈÝ¡£ÒªÊ¹Óà Nano ±à¼Îļþ£¬ÇëÔËÐУº
nano my_file.txt
µÇ¼ºó¸´ÖÆ
¾ÙÐÐÍê¸ü¸Äºó£¬°´ Ctrl + X ÉúÑIJ¢Í˳ö±à¼Æ÷¡£
4. ½ûÓÃдȨÏÞ£¨¿ÉÑ¡£©
ÈôÊÇÄú²»ÔÙÐèÒª¶ÔÎļþ¾ÙÐÐÐ޸ģ¬¿ÉÒÔÔٴνûÓÃдȨÏÞÒÔÌá¸ßÇå¾²ÐÔ¡£Òª½ûÓÃдȨÏÞ£¬ÇëÔËÐУº
chmod -w
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪΪ my_file.txt ½ûÓÃдȨÏÞ£¬ÇëÔËÐУº
chmod -w my_file.txt
µÇ¼ºó¸´ÖÆ
5. ÉúÑĵ½ÐÂÎļþ£¨¿ÉÑ¡£©
ÈôÊÇÄú²»ÏëÖ±½ÓÐÞ¸ÄÖ»¶ÁÎļþ£¬¿ÉÒÔ½«ÎļþµÄÄÚÈÝÉúÑĵ½Ò»¸öÐÂÎļþÖС£ÒªÉúÑĵ½ÐÂÎļþ£¬ÇëʹÓà cp ÏÂÁî¡£Óï·¨ÈçÏ£º
cp
µÇ¼ºó¸´ÖÆ
ÀýÈ磬Ҫ½« my_file.txt µÄÄÚÈÝÉúÑĵ½ my_file_new.txt ÖУ¬ÇëÔËÐУº
cp my_file.txt my_file_new.txt
µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬Äú¿ÉÒÔ¶Ô my_file_new.txt ¾ÙÐб༻òÐ޸ġ£
ÒÔÉϾÍÊÇlinuxÖ»¶ÁÎļþÔõôÐ޸ĵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡