❶ linux緋葷粺濡備綍鎶奤鐩橀噷鐨勬枃浠舵嫹璐濆埌鏈鍦
灝哢鐩樹笂鐨勬枃浠跺嶅埗鍒發inux鐩褰曚笅娑夊強鍒癱p浠ュ強mount絳夊懡浠わ紝涓嬮潰鍏堣蹭竴涓鍚勪釜鍛戒護
1銆 Linux 甯哥敤鍛戒護璇存槑
cp <婧愬湴鍧> <鐩鐨勫湴鍧>
璇ュ懡浠ゅ疄鐜癓inux涓嬫枃浠剁殑鎷瘋礉鍔熻兘錛屾簮鍦板潃涓洪渶瑕佹嫹鍑烘枃浠剁殑鍦板潃錛岀洰鐨勫湴鍧涓烘枃浠舵嫹璐濈殑鐩鏍囧湴鍧銆
渚1錛氭嫹璐/known/log鐩褰曚腑鐨勬枃浠跺悕涓簂og鐨勬枃浠跺埌/mnt鐩褰曚腑
cp /known/log/log /mnt
渚2錛氭嫹璐/known/log鐩褰曚腑鐨勬墍浠ユ枃浠跺埌/mnt鍛戒護涓
cp /known/log/* /mnt
ls <鐩褰>
璇ュ懡浠ゆ煡鐪婰inux褰撳墠鎴栬呮寚瀹氱洰褰曚腑鐨勫唴瀹
渚1錛氭煡鐪嬪綋鍓嶇洰褰曚笅鐨勫唴瀹
Ls
渚2錛氭煡鐪嬫寚瀹氱洰褰/known/log涓嬬殑鍐呭
ls /known/log
mount <璁懼囧悕縐> <鎸傝澆鍦板潃>
璇ュ懡浠ゅ疄鐜癓inux涓嬭懼囧強鏂囦歡鐨勬寕杞斤紝姣斿俇鐩樺強鍏夌洏鐨勬寕杞
渚1錛氭寕杞経鐩
mount /dev/sda /mnt
umount 鎸傝澆鍦板潃
璇ュ懡浠や笌mount閰嶅悎浣跨敤錛屽嵏杞藉凡緇忔寕杞界殑U鐩樻垨鑰呮枃浠剁郴緇
渚1錛氬嵏杞藉凡緇忔寕杞藉埌/mnt鐨刄鐩
umount /mnt
娉ㄦ剰錛氭墽琛岃ュ懡浠ゆ槸褰撳墠鐩褰曚竴瀹氫笉鑳芥槸闇瑕佸嵏杞界殑鐩褰曪紝鍚﹀垯浼氭彁紺鴻懼囧繖銆
cd <鐩褰>
璇ュ懡浠ゅ疄鐜癓inux鐩褰曠殑鍒囨崲
渚1錛氳繘鍏/known/log鐩褰
cd /known/log
渚2錛氳繘鍏/mnt
cd /mnt
渚3錛氳繘鍏/鐩褰
cd /
娉ㄦ剰錛歀inux鐩褰曠粨鏋勪負鏍戠姸緇撴瀯錛屽傛灉鎯沖垏鎹㈢洰褰曪紝鍦ㄤ笉鐔熸倝鐨勬儏鍐典笅涓瀹氳佹寚瀹氱粷瀵硅礬寰勶紝榪欐牱鏂逛究榪涘叆
2銆佹煡鐪婾鐩樺湪/dev鐢熸垚鐨勮懼囧悕縐
涓鑸鎯呭喌涓嬶紝褰撴彃鍏U鐩樺埌緋葷粺涔嬪悗錛屼細鍦/dev鐩褰曚笅鐢熸垚sda榪欎釜璁懼囧悕縐幫紝濡傛灉鎻掑叆U鐩樹箣鍚庢病鏈夎繖涓璁懼囧悕縐伴偅鍋氬備笅鍑犱釜姝ラょ殑鎿嶄綔錛氶栧厛錛岀『璁U鐩樻槸鍚︽e父錛屽叾嬈℃槸鍚︽g『鎻掑叆銆傚傛灉榪欎簺閮芥病鏈夐棶棰橀偅灝辯敤絎ㄤ竴鐐圭殑鏂規硶錛岄栧厛鎶奤鐩樻嫈鍑鴻板綍姝ゆ椂/dev閲岄潰鐨勮懼囧悕縐幫紝鐒跺悗鎻掑叆U鐩樼劧鍚庢瘮杈/dev鐩褰曚腑鍐呭備笌鏃犳彃鍏U鐩樼殑鍖哄埆銆備粠鑰岀『璁U鐩樼殑璁懼囧悕縐般
3銆佹搷浣滄ラ
涓嬮潰閫氳繃涓涓瀹炰緥鏉ヨ存槑濡備綍浠嶶鐩樹笂鐨勬枃浠跺嶅埗鍒發inux銆
1) 鎻掑叆U鐩
2) 鎵撳紑緇堢
3) 媯鏌/dev鐩褰昒鐩樼殑璁懼囨槸鍚﹀瓨鍦
鎵ц屽懡浠:fdisk -l鏌ョ湅U鐩樺瑰簲鐨勮懼囨枃浠 (渚嬪 /dev/sda)
4) 鎸傝澆U鐩樺埌/mnt鐩褰
鎵ц屽懡浠わ細mount /dev/sda /mnt
5) 媯鏌ユ寕杞芥槸鍚︽垚鍔
鎵ц屽懡浠わ細ls /mnt 鏌ョ湅mnt鐩褰曚腑鏄鍚︽湁鑷宸盪鐩樼殑鏂囦歡
6) 鎵ц屾枃浠舵嫹璐濆懡浠
cp -rf /mnt/abc.txt /known/ (灝哢鐩樺唴鐨刟bc.txt鎷瘋礉鍒/known鐩褰曚笅)
7) 媯鏌ユ枃浠舵槸鍚︽嫹璐濆畬鎴
ls /known/
ls /mnt
媯鏌ヤ袱涓鍛戒護鎵ц岀粨鏋
8) 鍗歌澆U鐩樻枃浠舵寕杞
umount /mnt
9) 瀹屾垚