❶ 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) 瀹屾垚