今いるディレクトリを変更する
「bash on Windows10」で今いるディレクトリを変更するには、以下のコマンドを実行します
cd (移動したいディレクトリ)
それでは実行してみましょう。windowsのCドライブに移動してみます。
「bash on Windows10」でWindowsのCドライブは「/mnt/c」というディレクトリ名になります
DESKTOP-1QGFR8O:~$ cd /mnt/c DESKTOP-1QGFR8O:/mnt/c$
今いるディレクトリが、WindowsのCドライブになりました。
Cドライブの内容を表示してみます。
t@DESKTOP-1QGFR8O:/mnt/c$ ls ls: cannot access Documents and Settings: Input/output error ls: cannot access pagefile.sys: Permission denied ls: cannot access swapfile.sys: Permission denied bootmgr Documents and Settings PerfLogs Program Files Recovery swapfile.sys Users BOOTNXT pagefile.sys ProgramData Program Files (x86) $Recycle.Bin System Volume Information Windows
WindowsのCドライブにあるディレクトリが表示されました。
2016年5月現在の「bash on Windows10」では、一部エラーが出ています。正式版だとエラーがなくなるかもしれません!