【Windows10/WSL】wslpathコマンドを試す

スポンサーリンク

Windows10の1803アップデートでは、WSL環境も強化されて、WSLパス名とWindowsパス名を変換する「wslpath」コマンドがサポートされたので試してみた。
WSL(Windows Subsystem for Linux)とは、Windows10上でUbuntuなどのLinuxを動かすというもの。

Windows10(1803)へアップデート
Windows10の1803アップデートが、昨日4月30日に公開されたとの事で、早速アップデートしてみた。 アップデート方法 スタートメニューから、設定 > 更新とセキュリティ > Windows Update を実行。 私の環境では、アッ...
【Windows10】WSL(Windows Subsystem for Linux)でUbuntuを使う
Windwos10 バージョン1709(Windows10 Fall Creators Update)からは、WSL(Windows Subsystem for Linux)が正式に利用できるようになった。 これは、Windows上でUbu...

追記(2018/05/15)

「Ubuntu 18.04」でも動くことを確認。

【Windows10】WSL(Windows Subsystem for Linux)で「Ubuntu 18.04」を使う
以前の記事で、Windows10のWSL(Windows Subsystem for Linux)で「Ubuntu」(16.04LTS相当)を動かした。 Microsoftストアを確認すると、先月リリースされた「Ubuntu 18.04 L...

wslpathコマンドを試す

WSLコンソールから、Windowsのファイルシステムへのアクセスは「/mnt/c/」のパスになっている。

$ wslpath c:/users
/mnt/c/Users
$ wslpath -w /mnt/c/Users
C:\Users

尚、wslpathコマンドの使い方は下記。

wslpath usage:
    -a    force result to absolute path format
    -u    translate from a Windows path to a WSL path (default)
    -w    translate from a WSL path to a Windows path
    -m    translate from a WSL path to a Windows path, with ‘/’ instead of ‘\\’

    EX: wslpath ‘c:\users’

WSLコンソールから、Windowsアプリを起動したりするのに重宝しそうなので活用していきたい。

参考

  1. WSL その142 – Windows 10の次期大型アップデート(バージョン1803)で何が変わるのか?・WSLとコンソールの新機能と変更点
  2. wslpath has no “usage” or “help” information #2715

コメント

タイトルとURLをコピーしました