WSL2備份、還原等基本操作

閱讀時間約 1 分鐘

檢查 WSL 版本

wsl --version

更新 WSL

wsl --update

WSL停止

wsl --terminate <Distribution Name>
實例=> 
wsl --terminate Ubuntu-20.04

WSL關機

wsl --shutdown

備份WSL

wsl --export <Distribution Name> <FileName>
實例=> 
wsl --export Ubuntu-20.04 E:\Ubuntu-20.04-20240319.tar

還原WSL

wsl --import <Distribution Name> <InstallLocation> <FileName>
實例=> 
wsl --import Ubuntu-20.04 c:\Ubuntu-20.04-20240319.tar



Ref.

https://learn.microsoft.com/zh-tw/windows/wsl/basic-commands

    1會員
    63內容數
    記錄生活與技術的小細節
    留言0
    查看全部
    發表第一個留言支持創作者!
    從 Google News 追蹤更多 vocus 的最新精選內容