Instructions for accessing Ubuntu Bash files on Windows

You can access the Windows system drive and any other drive on your computer from the Ubuntu Bash Shell. This allows you to work with normal Windows files using the Linux command utility.

The 'Bash on Ubuntu' environment on Windows' of Windows 10 contains several different components.

The first time you run the bash.exe program, it will download and install an entire Ubuntu environment. You can access files in File Explorer or other Windows programs, if you know the search location.

You can also access your Windows system drive and any other drive on your computer from the Ubuntu Bash Shell. This allows you to work with normal Windows files using the Linux command utility.

Instructions for accessing Ubuntu Bash files on Windows Picture 1Instructions for accessing Ubuntu Bash files on Windows Picture 1

1. Where are the Ubuntu Bash Shell files stored on Windows?

Note, each Windows user account using Bash will have a separate Bash environment and files in the directory.

To access these files, you must first set up the display of hidden folders on File Explorer.

Open the File Explorer window, then click View => Options => Change Folder and Search Options .

On the Folder Options window, select View => Show Hidden files, Folders and Drivers .

Instructions for accessing Ubuntu Bash files on Windows Picture 2Instructions for accessing Ubuntu Bash files on Windows Picture 2

Navigate following the path below to find the directory:

C: UsersUSERNAMEAppDataLocallxss

Ubuntu system files are stored at:

C: UsersUSERNAMEAppDataLocalLxssrootfs

The Ubuntu account directory of the main user is stored at:

C: UsersUSERNAMEAppDataLocalLxsshomeUSERNAME

The main Root account directory is stored at:

C: UsersUSERNAMEAppDataLocalLxssroot

Instructions for accessing Ubuntu Bash files on Windows Picture 3Instructions for accessing Ubuntu Bash files on Windows Picture 3

2. Location of Windows system drive on Bash

The Ubuntu Bash Shell environment makes your entire Windows system available to work with the same files on both environments.

However, the Bash environment does not appear in the C: drive. Instead, it is placed in / or the root directory you have on Linux. If you perform a ls command to view the contents of the directory, you will only see Ubuntu directories that provide the Linux environment.

Instructions for accessing Ubuntu Bash files on Windows Picture 4Instructions for accessing Ubuntu Bash files on Windows Picture 4

On the Windows system drive and other connections in the / mnt / directory - the location of other drives is available on the Linux directory structure.

In particular, you'll find drive C according to the path below in the Bash environment:

/ mnt / c

To change this directory with the cd command, run the following command:

cd / mnt / c

If you have a D: drive, you will find the D: drive in / mnt / d.

For example to access files stored in C: UsersChrisDownloadsFile.txt , you use the path /mnt/c/Users/Chris/Downloads/File.txt in the Bash environment.

Instructions for accessing Ubuntu Bash files on Windows Picture 5Instructions for accessing Ubuntu Bash files on Windows Picture 5

Note that, when you access Windows system files, your Bash Shell environment must have repository permissions to run those files. If you launch the file in the usual way from the shortcut, it will have access to the file with your Windows user account.

For example, if you want to access the C: Users folder of the Administrator folder , you must right-click the Bash shell shortcut and select "Run as Administrator" to start the Bash Shell with Admin rights on Windows.

This process works similarly to the Command Prompt, it needs to start under Admin if you want to write, access Admin rights - only files, or write access to system files. Also, you cannot use sudo on a Bash environment.

Refer to some of the following articles:

  1. Ubuntu Bash tutorial on Windows 10
  1. Instructions for managing programs in Ubuntu via the command line
  1. How to enable automatic system update mode on Ubuntu

Good luck!

5 ★ | 1 Vote