- 2 Ways to Copy Files from Windows 10 to Windows Sub-System for Linux
- Distribution Package of Windows Sub-System for Linux
- Copy Files
- Method 1 – Manual Copy-Paste
- Method 2 – Windows System Drive as a Mount point
- Video Tutorial
- My New Book : PowerShell Scripting Guide to Python
- Как скопировать или переместить файлы из Windows в Linux
- Сохраняйте данные на общем жестком диске
- Другие способы доступа к данным Windows из Linux
- Перезагрузите компьютер
- Смонтируйте жесткий диск NTFS
- Восстановить данные Linux из Windows
- Перезагрузите компьютер
- Используйте программу для чтения EXT4
- Используйте подсистему Windows для Linux
- Copy window file to linux
- Copying Files Between Windows and Linux using PuTTY
- Copy files between Linux and Windows
- Contents
- You are on a Linux host
- You want to access a Windows drive
- troubleshooting
- You want to share a folder
- You are on a Windows host
- You want to access a Linux drive
- You want to share a folder
2 Ways to Copy Files from Windows 10 to Windows Sub-System for Linux
Today we are going to discuss about how to copy file from your Windows 10 machine to Windows Sub-System for Linux.
Distribution Package of Windows Sub-System for Linux
First thing first, before you can even begin you have to understand where all the Linux files are placed in your Windows 10 machine. To avoid any accidental tampering Microsoft stores all you Linux files under the following hidden folder:
Here you can find your Linux distribution packages (distro) , double-click on the folder for your distribution, following is name of distribution package and folder name mapping:
Distribution Package | Folder Name |
---|---|
Ubuntu | CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc |
openSUSE Leap 42 | 46932SUSE.openSUSELeap42.2_022rs5jcyhyac |
SUSE Linux Enterprise Server 12 | 46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac |
For Ubuntu which I’m using, I’ll look for CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc and then navigate to folder navigate to .\LocalState\rootfs\ folder. This is the root file share where all you files are placed
Copy Files
Method 1 – Manual Copy-Paste
You can simply move or copy-paste files inside one of these Linux directories,
but the files won’t appear in you Windows Sub-system for Linux Bash Shell until you restart it.
Method 2 – Windows System Drive as a Mount point
Windows Sub-System for Linux provides you access to the Windows 10 system drive by mounting the C:\ . On Linux if you go to you root directory and list all directories, then you will notice a /mnt/c/ which is Windows 10 C:\ mounted on Linux
Now simply use copy command ( cp ) to copy files over to your Linux Subsystem.
Video Tutorial
If you like this article read more similar articles under ‘N – Ways to’ category
My New Book : PowerShell Scripting Guide to Python
This PowerShell Scripting guide to Python is designed to make readers familiar with syntax, semantics and core concepts of Python language, in an approach that readers can totally relate with the concepts of PowerShell already in their arsenal, to learn Python fast and effectively, such that it sticks with readers for longer time.
“Use what you know to learn what you don’t. ” also known as Associative learning.
Book follows a comparative method to jump start readers journey in Python, but who is the target audience? and who should read this book –
- Any System Administrator who want to step into Development or Programming roles, and even if you don’t want to be a developer, knowledge of another scripting language will make your skill set more robust.
- Python Developers who want to learn PowerShell scripting and understand its ease of user and importance to manage any platform.
Python is one of the top programming languages and in fast changing IT scenarios to DevOps and Cloudto the future – Data Science, Artificial Intelligence (AI) and Machine Learning Python is a must know.
But this PowerShell Scripting guide to Python would be very helpful for you if you already have some knowledge of PowerShell
NOTE! This is a Leanpub “Agile-published” book. That means the book is currently unfinished and in-progress. As I continue to complete the chapters, we will re-publish the book with the new and updated content. Readers will receive an email once a new version is published!
While the book is in progress, please review it and send any feedback or error corrections at [email protected]
Follow @SinghPrateik
Источник
Как скопировать или переместить файлы из Windows в Linux
Зачем отказываться от использования одной операционной системы? Сегодня на один компьютер можно установить две и более операционных системы. И хотя мы можем сделать это несколькими способами (виртуальные машины, Windows подсистемы и т. д.), способ воспользоваться преимуществами 100% операционной системы — это физически установить ее на ПК благодаря двойной загрузке или двойной загрузке. Однако, когда мы переключаемся с одной системы на другую, мы можем столкнуться с некоторыми проблемами. Особенно при попытке получить доступ к нашим файлам из Windows и Linux.
Каждая операционная система использует свою файловую систему. Windows, например, использует NTFS на его основном разделе; macOS использует собственную систему, НПФ ; и Linux, хотя он совместим с большим количеством файловых систем, в большинстве дистрибутивов наиболее часто используется EXT4 . Поскольку каждая система использует свои собственные форматы, доступ к разделам других операционных систем затруднен (и опасен). Итак, если мы используем Linux и нам нужно получить доступ к файлу, сохраненному на жестком диске Windows, что мы можем сделать?
Сохраняйте данные на общем жестком диске
Если мы хотим избежать проблем такого типа, лучшее, что мы можем сделать, это создать общий диск, на котором мы сможем сохранять данные всех операционных систем, которые мы используем. Этим устройством может быть жесткий диск или раздел, который у нас есть внутри нашего ПК, или внешний жесткий диск, который мы подключили к ПК. Важно то, что на этом диске файловая система совместима как с Windows, так и с Linux. И хотя мы можем использовать для этого NTFS, лучшее, что мы можем выбрать, чтобы избежать проблем, — это ExFAT .
И Windows, и Linux смогут читать и записывать на диск exFAT. без проблем. Эта файловая система представляет собой улучшенную версию FAT32, в которой, среди прочего, устранено ограничение в 4 ГБ на файл. Следовательно, мы можем использовать его как связующее звено между всеми нашими операционными системами. Важно убедиться, что мы храним все данные там.
Еще одна альтернатива, которую мы можем использование — это сервер NAS . Эти серверы подключены к сети и позволяют любому подключенному к ней пользователю получать доступ к данным. Обычно они монтируют сервер SMB / SAMBA, поэтому файлы будут доступны как в Windows, так и в Linux.
Другие способы доступа к данным Windows из Linux
В этом случае мы посмотрим, что мы можем сделать, если нам понадобится доступ к файлу из Linux, который мы сохранили на жестком диске Windows.
Перезагрузите компьютер
Самый простой и в то же время безопасный — это перезагрузите компьютер и вернитесь в Windows . Таким образом, мы снова получим доступ ко всем файлам, которые мы сохранили на этом жестком диске, и, следовательно, сможем получить к нему доступ. Теперь, когда мы находимся в Windows, мы можем выбрать, делать ли то, что мы хотели, из Microsoft операционной системы, или передать файл в Linux, либо через флешку, либо с жесткого диска nexus, что мы объяснили в предыдущем пункте.
Это самый безопасный способ сделать это, поскольку, не заходя на жесткий диск Windows из Linux, мы избегаем изменения разрешений или повреждения файлов, что избавляет нас от проблем. Однако это самый медленный метод.
Смонтируйте жесткий диск NTFS
Linux способен чтение и запись на диски NTFS. Само ядро имеет собственный контроллер, и для этого есть другие сторонние инструменты. Чтение файлов из раздела NTFS из Linux обычно работает нормально, обычно не вызывает проблем. Но если мы собираемся внести какие-либо изменения, мы рискуем, что что-то пойдет не так и некоторые данные будут повреждены. Windows может быть повреждена, или мы можем потерять файлы.
Если мы знаем, что собираемся делать, мы можем смонтировать NTFS-диск Windows и получить доступ ко всем его данным. Пока мы ничего не трогаем и не изменяем, мы можем копировать (да, лучше копировать, чем перемещать) файл или файлы, которые нам нужны, с этого устройства в раздел Linux, и, таким образом, мы можем работать с ними без проблем.
Это самый быстрый способ, но и самый рискованный. И это будет возможно только в том случае, если у нас нет диска, зашифрованного с помощью Bitlocker.
Восстановить данные Linux из Windows
Что, если мы используем Linux, мы возвращаемся в Windows и забыли файл? Здесь у нас есть несколько способов повторно получить доступ к данным.
Перезагрузите компьютер
Как и в предыдущем случае, самый безопасный и простой способ — это перезагрузите компьютер и снова войдите в Linux . Оказавшись там, мы можем скопировать файл на флешку или внешний жесткий диск и снова перезапустить, чтобы перенести его в Linux. Это самый долгий и утомительный процесс, но он и самый безопасный.
Используйте программу для чтения EXT4
Windows по умолчанию не может читать или записывать на диски Linux EXT. Следовательно, если мы хотим получить доступ к данным, необходимо установить программу, которая позволяет нам это делать. Существует очень разнообразное программное обеспечение, как бесплатное, так и платное, которое позволяет нам это делать. Однако большинство из них — это довольно устаревшие программы, которые, хотя и могут работать, но также могут выдавать ошибки.
Если мы не собираемся писать в этих модулях и хотим только передавать данные, мы можем прибегнуть к этим программам. Если нет, лучше найти другую альтернативу.
Используйте подсистему Windows для Linux
Microsoft очень сильно делает ставку на интеграцию Linux в Windows. Благодаря Подсистема Windows для Linux , WSL, можно загрузить полный экземпляр Linux поверх операционной системы благодаря Hyper-V. С появлением WSL2 Windows может монтировать и использовать диски Linux EXT4, как если бы это был жесткий диск, более подключенный к компьютеру.
Если мы опытные пользователи, у которых включен WSL в Windows, и мы хотим получить доступ к данным Linux из операционной системы Microsoft, это лучший вариант. В любом случае, мы надеемся, что Microsoft скоро упростит этот процесс, добавив почти встроенную поддержку EXT4 из Windows.
Источник
Copy window file to linux
- Home
- :
- i.MX Forums
- :
- i.MX Processors
- :
- Copying Files Between Windows and Linux using PuTT.
Copying Files Between Windows and Linux using PuTTY
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Here’s a neat way to transfer files between your Windows PC and your Linux (Ubuntu) project using Ethernet.
PuTTY is a program that connects one device to another over the network. It supports SSH and Telnet, among others.
PuTTY is a “client” application that talks to a “host”. The host must be running an SSH server (which is often the case for iMX Linux enabled systems).
A Windows version exists and this is ideal for transferring files between your Windows PC and a Linux Platform.
Select the Windows Installer version. This installs the programs and help files you will need.
File transfers can be done using PSCP (Putty Secure CoPy) or by using PSFTP (Putty Secure File Transfer Protocol).
PSFTP can be launched from the Windows Start.
PSCP must be launched from within a DOS box (Start Wingdings»»> à Run and enter cmd, then press OK). Before
running PSCP, you need to set the path variable. At the DOS command prompt, type
set PATH=C:\Program Files\PuTTY
This assumes you installed PuTTY in C:\Program Files\PuTTY (default). Note the “\” slash.
This will only work for the lifetime of that particular console window. To set your PATH more permanently on Windows NT, 2000, and XP, use the Advanced tab of the System Control Panel (right-click on MyComputer then select Properties). Click the Environment Variables button, high-light “path” and edit it. Add “;C:\Program Files\PuTTY” at the end of
the line. You can then verify the path is correct by typing “path” at the DOS prompt.
The format for pscp is straight forward:
pscp [options] source destination
To copy a Windows file to Linux system, at the DOS prompt, type
pscp c:/music.mp3 ubuntu@10.0.0.3:/home/ubuntu/Music
which will copy the file music.mp3 to my Music folder into Linux. My Ubuntu EVK has an ip address as 10.0.0.3. (Note that you can use either / or \ for the Windows files and directories, but you must use / when specifying the Linux files.)
The reverse works as well (copy Linux file to Windows)
pscp ubuntu@10.0.0.3:/home/ubuntu/Music/music.mp3 c:/
This copies the music.mp3 file from Linux into my C root directory.
There are many other options available, including the ability to use the ftp protocol as well. See the help file for more information.
Источник
Copy files between Linux and Windows
This describes how to copy files over the network between a computer (or virtual machine) running Windows and another computer (or virtual machine) running Linux.
There is also an article how to access a Linux partition when running Windows and how to access a Windows partition when running Linux. You may need this if your computer is running only one operating system and having two hard disk partitions.
Contents
You are on a Linux host
You want to access a Windows drive
So you are on a Linux computer and want to access a Windows drive over the network. This explains how. In this example we assume winhost is your Windows computer’s hostname (you can check the hostname by right clicking on My Computer and selecting Properties). Go to the Windows computer and open the Explorer. Share a folder by right-clicking onto it and selecting «Sharing and security». Call it «share1». Then, on your Linux computer,
- Open up your favorite file explorer, perhaps Konqueror or Nautilus
- In the address bar, type smb://winhost/share1
- You should now see the files and folders in that share. Double-click on them to open them up and view them.
troubleshooting
If that doesn’t work, then you may need to do something more complicated.
- install the samba client software
- try to find the share:
- If you see the share, mount it like this:
- after the next reboot, your mount will be lost. To make it persistant, add the following line to your /etc/fstab:
You want to share a folder
So you are on a Linux computer and want to share a folder so that also Windows machines can access it over the network. To do this, you run the SAMBA service on your computer. To enable sharing to Windows machines, right click on a folder in Nautilus; the menu should have an item called «Sharing Options». Click it and pick the name for your share. If you don’t have Windows folder sharing enabled yet, Nautilus will ask you for a password and install the service, after which you will need to log out and back in. The share should now be available on the Windows computer.
You are on a Windows host
You want to access a Linux drive
Use WinSCP. Choose the SFTP protocol; the login and password are the same as those you use when logging in locally. If it does not work, look at your Linux computer: Try to shut down your firewall and install the openssh service.
You want to share a folder
You can share files with Linux using normal Windows sharing mechanisms. The Linux host will be able to access these files using samba.
Источник