How To Access Windows Files From Ubuntu Terminal
Linux environments you install from the Store (like Ubuntu and openSUSE) continue their files in a hidden folder. You can access this folder to back up and view files. You can too admission your Windows files from the Bash shell.
Update: Starting with Windows x'south May 2019 Update, there'due south at present an official, safe way to admission your Linux files from Windows applications.
Don't Modify Linux Files With Windows Tools
Microsoft strongly warns against adding or modifying Linux files with Windows software. This could crusade metadata problems or file abuse, and may forcefulness you to uninstall and reinstall your Linux distribution to fix it. Withal, you lot tin withal view and support your Linux files using Windows software, and that won't cause any problems.
In other words, treat the Linux folder every bit if it were read-only from inside Windows. Don't use whatever Windows tool, including graphical apps or command line tools, to modify them. Don't create new files within these folders using Windows tools, either.
If y'all exercise want to work with a file from both the Linux and Windows environments, you should create information technology in your Windows file system. For example, if you lot have a binder at C:\project in Windows, you could also access it at /mnt/c/project in the Linux environment. Because it'southward stored on the Windows file system and is accessed under /mnt/c, information technology'due south safety to modify the file with either Windows or Linux tools.
Where Windows Stores the Linux Files
Your Linux file system is stored in a hidden folder for a reason, as Microsoft doesn't want you lot tampering with information technology. Just, if yous demand to view or back upwardly some files, you'll find them stored in a hidden folder. To access information technology, open File Explorer and plug the following accost into the accost bar:
%userprofile%\AppData\Local\Packages
(This takes you lot to C:\Users\NAME\AppData\Local\Packages
. You tin can also bear witness hidden folders in File Explorer and navigate hither manually, if you lot prefer.
In this folder, double-click the folder for the Linux distribution whose files you desire to view:
- Ubuntu: CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
- openSUSE Leap 42: 46932SUSE.openSUSELeap42.2_022rs5jcyhyac
- SUSE Linux Enterprise Server 12: 46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac
The names of these folders may alter slightly in the time to come. Just look for a folder named after the Linux distribution.
In the Linux distribution's folder, double-click the "LocalState" folder, and so double-click the "rootfs" folder to see its files.
In other words, the files are stored at:
C:\Users\Proper noun\AppData\Local\Packages\DISTRO_FOLDER\LocalState\rootfs
Note: In older versions of Windows 10, these files were stored nether C:\Users\Proper name\AppData\Local\lxss. This changed starting with the Autumn Creators Update.
To view the files stored in your habitation folder, double-click the "dwelling house" folder, and and then double-click your UNIX username.
Remember, don't modify any of these files or add files to these folders from File Explorer!
Where Your Windows Organization Drive Appears in Linux
The Windows Subsystem for Linux makes your full Windows arrangement bulldoze available so you tin can piece of work with the same files in both environments. All the same, the Bash environs doesn't merely dump you in your C:\ drive. Instead, information technology places you in your UNIX account's habitation directory inside the Linux environs'due south file arrangement.
Your Windows system drive and other connected drives are exposed in the /mnt/ directory there, where other drives are traditionally fabricated bachelor in the Linux directory structure. Specifically, you'll find the C: drive at the following location in the Bash environment:
/mnt/c
To change to this directory with the cd
control, simply type:
cd /mnt/c
If you have a D: drive, you'll notice it located at /mnt/d, and so on.
For example, to access a file stored at C:\Users\Chris\Downloads\File.txt, you'd utilise the path /mnt/c/Users/Chris/Downloads/File.txt in the Bash environment. And yep, it's instance-sensitive, so you lot need "Downloads" and non "downloads."
RELATED: How to Mount Removable Drives and Network Locations in the Windows Subsystem for Linux
You tin can also mount external drives and network locations to access more files from within the Linux environment.
Note that, when accessing Windows organisation files, your Bash shell environment has the permissions it was launched with. If yous launched it usually from the shortcut, it will accept the same file access permissions your Windows user business relationship does.
For example, if you desire to access a organization folder your user account doesn't have permission to access, y'all'd demand to right-click the Bash vanquish shortcut and select "Run every bit Administrator" to launch the Bash shell with Windows Administrator privileges.
This works just like the Command Prompt, which needs to be launched as Administrator if you demand write access to Ambassador-only files, or write admission to organisation files. You can't just use sudo
in the Bash environment.
How To Access Windows Files From Ubuntu Terminal,
Source: https://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/
Posted by: wattsfarands.blogspot.com
0 Response to "How To Access Windows Files From Ubuntu Terminal"
Post a Comment