Instructions for accessing Ubuntu Bash files on Windows
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.
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 .
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
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.
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.
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:
- Ubuntu Bash tutorial on Windows 10
- Instructions for managing programs in Ubuntu via the command line
- How to enable automatic system update mode on Ubuntu
Good luck!
You should read it
- Everything you can do with the new Windows 10 Bash Shell
- How to Install and Run Bash on Windows 11
- How to create and open folders in VS Code with Git Bash for Windows
- Shortcuts to copy - paste coming soon on Windows 10's Bash Console
- How to use Zsh (or other Shells) on Windows 10?
- Running Linux on Windows 10 does not require a virtual machine, here are 18 things you should know
- How to simplify 7z file compression with Bash Alias
- Tips and tricks after installing Ubuntu
May be interested
- How to create an ISO file on Linuxyou may know that an iso file can be burned to a cd / dvd or usb drive, but do you know that you backup or store your files and folders into an iso file? will be better? with an iso file, you can burn it to a cd / dvd as a backup or simply mount it as an external drive and access files from within.
- How to run 2 or more Terminal commands at the same time on Linuxif you use linux, you probably know how to use useful commands to work with files, install software and launch programs. however, one thing you don't know is that you can still run multiple commands at the same time.
- This is how to 'recover' a failed USB drive on Linuxoften users use usb drives to store data securely. however in some cases the usb drive may be faulty or simply not work. if you are using a linux operating system and you have a similar error on the usb drive, then you can use the commands to restore the usb drive.
- Instructions to disable Root account on Linuxif you're a linux user, you've probably heard the phrase 'root'. basically root is the account that has complete control of the entire linux system, which means that when using a root account you can change any settings on the system. this can cause extremely dangerous problems for system security, and advice if you are a 'high-end' user should use root.
- Display IP address on the system tray on Ubuntuin some cases, troubleshooting a problem requires a computer ip address to check the system ip address. if you are using ubuntu and want to find the available ip address on your computer, you can display ip address in the system tray.
- Running Linux on Windows 10 does not require a virtual machine, here are 18 things you should knowthe windows subsystem for linux (wsl) feature - also called bash, helps programmers run ubuntu directly on windows without the need for a virtual machine. the following article will help readers better understand linux tools - wsl.