Why, when I create a file from within Windows for example, can I not see it under the Linux sub system in Windows 10 (bash.exe)
The screenshot should explain.
Folder: OMG was created from within Windows Explorer. Folder OMGBash was created from with Linux sub system bash.exe
When a folder OR file is created outside of bash.exe I can never see it, regardless of permissions and ownership.
To show the information I have had to use Cygwin to show file permissions, I have also altered the permissions to see if the folder would appear. (The two command windows at the bottom)
Screenshot showing folder, bash.exe and Cygwin permissions:
I am trying to move all my Cygwin scripts over to the Linux subsystem, but I don't fancy recreating every file, then having to copy and past using bash, then reformatting then using Dos2unix (very long winded).
Found this on GitHub for the Linux subsystem:
copying directly into the Linux subsystem from Windows is not supported, according to discussion on other tickets. There is a directory under AppData somewhere (I forget where) that appears to contain the files for the WSL filesystem. But if you put new files there, or modify existing files there, your changes are not reflected correctly inside WSL.
My best guess is that Linux needs to store different metadata (and more caching information, etc, since its disk-buffering model is also different) about its files than Windows does, and that this is currently implemented by storing the master copy of the structure of the Linux filesystem in a database of some sort, and just using the Windows filesystem as a convenient BLOB-store for that database.
If you really need to do this, a workaround would be to write a drag'n'drop .bat script or somesuch that does bash.exe -c "mv %1 /home/$USER/". (You'll have to do some clever work with sed and tr, probably, to translate %1 to a valid WSL path.)
Alternatively -- could you put your files in a Windows directory and, within WSL, do "cd ~; ln -s /mnt/c/path/to/my/files" to make them appear to be in your WSL homedir?
cp -r --no-preserve=all
To drop the previous permissions. Still, if you want to make any heavy changes, you cannot use a windows application to edit the file in the LinuxSubSystem, You have to edit it, in your windows Directory and then copy it over. Now i know this, its workable, BUT i was under the impression the Linux Sub System was more native / integrated into windows than an Isolated OS%LocalAppData%\Packages\<some-long-name-of-distro>\LocalState\rootfs
.