Export files from Ubuntu WSL


up vote
2
down vote
favorite
How can I export files from Ubuntu WSL to windows or any other directory so that I can use/edit that file in windows
windows-10 windows-subsystem-for-linux
add a comment |Â
up vote
2
down vote
favorite
How can I export files from Ubuntu WSL to windows or any other directory so that I can use/edit that file in windows
windows-10 windows-subsystem-for-linux
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
1
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
How can I export files from Ubuntu WSL to windows or any other directory so that I can use/edit that file in windows
windows-10 windows-subsystem-for-linux
How can I export files from Ubuntu WSL to windows or any other directory so that I can use/edit that file in windows
windows-10 windows-subsystem-for-linux
asked May 20 at 15:08


Shubham Surve
161
161
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
1
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23
add a comment |Â
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
1
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
1
1
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
The short answer is right now you can not, but there are some solutions.
First the warnings:
See https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
I have to provide this guidance at least 2-3 times a day so instead I
am publishing it here so everyone can find / link-to this guidance.
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files
using Windows apps, tools, scripts, consoles, etc. Also note: Opening
files using some Windows tools may read-lock the opened files and/or
folders, preventing updates to file contents and/or metadata,
essentially resulting in corrupted files/folders.
Creating/changing Linux files from Windows will likely result in data
corruption and/or damage your Linux environment requiring you to
uninstall & reinstall your distro! Note: Your "Linux files" are any of
the files and folders under %localappdata%lxss - which is where the
Linux filesystem - distro and your own files - are stored on your
drive
But this means any files in %localappdata%lxss
Read the link for full details and additional information as to why. To the best of my knowledge this is currently marked as "might fix" (upgraded from "wont fix").
There are a few options:
First:
So what SHOULD I do?
To work on files using both Windows and Linux tools, store & work on
those files in your Windows filesystem, and access them from both
Windows and from Bash via /mnt//path (e.g.
/mnt/c/dev/project/...)
There are "work arounds" listed here :
https://github.com/Microsoft/WSL/issues/1524
But no guarantee you will not break things if you try those.
Second, make a shared directory in windows and mount it in WSL:
You can also try https://github.com/Microsoft/WSL/issues/1319
Make a folder in Windows, call it
%userprofile%projects
In Windows subsystem for linux, do the following:
ln -s /mnt/c/Users/[YourWindowsUserName]/projects ~/projects
Any Linux-related file that you want to edit, edit it in ~/projects,
and you will be 100% fine.
Third (possibly best for some) is to use the linux tools.
nano
is an easy to use command line editor
nano file_to_edit
The key combinations to save / exit are at the bottom of the editor
Here is a basic nano guide: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
add a comment |Â
up vote
0
down vote
The easiest way of editing Linux files stored in WSL (Windows Subsystem for Linux) is to use Linux GUI applications. After the initial setup of Ubuntu for Windows 10 is complete you need to install vcxsrv
and Ubuntu desktop. This will give you full access to GUI apps such as gedit
and run scripts that contain GUI dialogs such as zenity
or yad
.
See this answer: What's the easiest way to run GUI apps on WSL as of 2018?
If you use a Windows app to modify a Linux file stored in a WSL directory you will corrupt the data:
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
The short answer is right now you can not, but there are some solutions.
First the warnings:
See https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
I have to provide this guidance at least 2-3 times a day so instead I
am publishing it here so everyone can find / link-to this guidance.
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files
using Windows apps, tools, scripts, consoles, etc. Also note: Opening
files using some Windows tools may read-lock the opened files and/or
folders, preventing updates to file contents and/or metadata,
essentially resulting in corrupted files/folders.
Creating/changing Linux files from Windows will likely result in data
corruption and/or damage your Linux environment requiring you to
uninstall & reinstall your distro! Note: Your "Linux files" are any of
the files and folders under %localappdata%lxss - which is where the
Linux filesystem - distro and your own files - are stored on your
drive
But this means any files in %localappdata%lxss
Read the link for full details and additional information as to why. To the best of my knowledge this is currently marked as "might fix" (upgraded from "wont fix").
There are a few options:
First:
So what SHOULD I do?
To work on files using both Windows and Linux tools, store & work on
those files in your Windows filesystem, and access them from both
Windows and from Bash via /mnt//path (e.g.
/mnt/c/dev/project/...)
There are "work arounds" listed here :
https://github.com/Microsoft/WSL/issues/1524
But no guarantee you will not break things if you try those.
Second, make a shared directory in windows and mount it in WSL:
You can also try https://github.com/Microsoft/WSL/issues/1319
Make a folder in Windows, call it
%userprofile%projects
In Windows subsystem for linux, do the following:
ln -s /mnt/c/Users/[YourWindowsUserName]/projects ~/projects
Any Linux-related file that you want to edit, edit it in ~/projects,
and you will be 100% fine.
Third (possibly best for some) is to use the linux tools.
nano
is an easy to use command line editor
nano file_to_edit
The key combinations to save / exit are at the bottom of the editor
Here is a basic nano guide: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
add a comment |Â
up vote
4
down vote
The short answer is right now you can not, but there are some solutions.
First the warnings:
See https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
I have to provide this guidance at least 2-3 times a day so instead I
am publishing it here so everyone can find / link-to this guidance.
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files
using Windows apps, tools, scripts, consoles, etc. Also note: Opening
files using some Windows tools may read-lock the opened files and/or
folders, preventing updates to file contents and/or metadata,
essentially resulting in corrupted files/folders.
Creating/changing Linux files from Windows will likely result in data
corruption and/or damage your Linux environment requiring you to
uninstall & reinstall your distro! Note: Your "Linux files" are any of
the files and folders under %localappdata%lxss - which is where the
Linux filesystem - distro and your own files - are stored on your
drive
But this means any files in %localappdata%lxss
Read the link for full details and additional information as to why. To the best of my knowledge this is currently marked as "might fix" (upgraded from "wont fix").
There are a few options:
First:
So what SHOULD I do?
To work on files using both Windows and Linux tools, store & work on
those files in your Windows filesystem, and access them from both
Windows and from Bash via /mnt//path (e.g.
/mnt/c/dev/project/...)
There are "work arounds" listed here :
https://github.com/Microsoft/WSL/issues/1524
But no guarantee you will not break things if you try those.
Second, make a shared directory in windows and mount it in WSL:
You can also try https://github.com/Microsoft/WSL/issues/1319
Make a folder in Windows, call it
%userprofile%projects
In Windows subsystem for linux, do the following:
ln -s /mnt/c/Users/[YourWindowsUserName]/projects ~/projects
Any Linux-related file that you want to edit, edit it in ~/projects,
and you will be 100% fine.
Third (possibly best for some) is to use the linux tools.
nano
is an easy to use command line editor
nano file_to_edit
The key combinations to save / exit are at the bottom of the editor
Here is a basic nano guide: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
add a comment |Â
up vote
4
down vote
up vote
4
down vote
The short answer is right now you can not, but there are some solutions.
First the warnings:
See https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
I have to provide this guidance at least 2-3 times a day so instead I
am publishing it here so everyone can find / link-to this guidance.
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files
using Windows apps, tools, scripts, consoles, etc. Also note: Opening
files using some Windows tools may read-lock the opened files and/or
folders, preventing updates to file contents and/or metadata,
essentially resulting in corrupted files/folders.
Creating/changing Linux files from Windows will likely result in data
corruption and/or damage your Linux environment requiring you to
uninstall & reinstall your distro! Note: Your "Linux files" are any of
the files and folders under %localappdata%lxss - which is where the
Linux filesystem - distro and your own files - are stored on your
drive
But this means any files in %localappdata%lxss
Read the link for full details and additional information as to why. To the best of my knowledge this is currently marked as "might fix" (upgraded from "wont fix").
There are a few options:
First:
So what SHOULD I do?
To work on files using both Windows and Linux tools, store & work on
those files in your Windows filesystem, and access them from both
Windows and from Bash via /mnt//path (e.g.
/mnt/c/dev/project/...)
There are "work arounds" listed here :
https://github.com/Microsoft/WSL/issues/1524
But no guarantee you will not break things if you try those.
Second, make a shared directory in windows and mount it in WSL:
You can also try https://github.com/Microsoft/WSL/issues/1319
Make a folder in Windows, call it
%userprofile%projects
In Windows subsystem for linux, do the following:
ln -s /mnt/c/Users/[YourWindowsUserName]/projects ~/projects
Any Linux-related file that you want to edit, edit it in ~/projects,
and you will be 100% fine.
Third (possibly best for some) is to use the linux tools.
nano
is an easy to use command line editor
nano file_to_edit
The key combinations to save / exit are at the bottom of the editor
Here is a basic nano guide: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
The short answer is right now you can not, but there are some solutions.
First the warnings:
See https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
I have to provide this guidance at least 2-3 times a day so instead I
am publishing it here so everyone can find / link-to this guidance.
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files
using Windows apps, tools, scripts, consoles, etc. Also note: Opening
files using some Windows tools may read-lock the opened files and/or
folders, preventing updates to file contents and/or metadata,
essentially resulting in corrupted files/folders.
Creating/changing Linux files from Windows will likely result in data
corruption and/or damage your Linux environment requiring you to
uninstall & reinstall your distro! Note: Your "Linux files" are any of
the files and folders under %localappdata%lxss - which is where the
Linux filesystem - distro and your own files - are stored on your
drive
But this means any files in %localappdata%lxss
Read the link for full details and additional information as to why. To the best of my knowledge this is currently marked as "might fix" (upgraded from "wont fix").
There are a few options:
First:
So what SHOULD I do?
To work on files using both Windows and Linux tools, store & work on
those files in your Windows filesystem, and access them from both
Windows and from Bash via /mnt//path (e.g.
/mnt/c/dev/project/...)
There are "work arounds" listed here :
https://github.com/Microsoft/WSL/issues/1524
But no guarantee you will not break things if you try those.
Second, make a shared directory in windows and mount it in WSL:
You can also try https://github.com/Microsoft/WSL/issues/1319
Make a folder in Windows, call it
%userprofile%projects
In Windows subsystem for linux, do the following:
ln -s /mnt/c/Users/[YourWindowsUserName]/projects ~/projects
Any Linux-related file that you want to edit, edit it in ~/projects,
and you will be 100% fine.
Third (possibly best for some) is to use the linux tools.
nano
is an easy to use command line editor
nano file_to_edit
The key combinations to save / exit are at the bottom of the editor
Here is a basic nano guide: https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
edited May 20 at 16:37
answered May 20 at 16:27


Panther
74.7k10149256
74.7k10149256
add a comment |Â
add a comment |Â
up vote
0
down vote
The easiest way of editing Linux files stored in WSL (Windows Subsystem for Linux) is to use Linux GUI applications. After the initial setup of Ubuntu for Windows 10 is complete you need to install vcxsrv
and Ubuntu desktop. This will give you full access to GUI apps such as gedit
and run scripts that contain GUI dialogs such as zenity
or yad
.
See this answer: What's the easiest way to run GUI apps on WSL as of 2018?
If you use a Windows app to modify a Linux file stored in a WSL directory you will corrupt the data:
add a comment |Â
up vote
0
down vote
The easiest way of editing Linux files stored in WSL (Windows Subsystem for Linux) is to use Linux GUI applications. After the initial setup of Ubuntu for Windows 10 is complete you need to install vcxsrv
and Ubuntu desktop. This will give you full access to GUI apps such as gedit
and run scripts that contain GUI dialogs such as zenity
or yad
.
See this answer: What's the easiest way to run GUI apps on WSL as of 2018?
If you use a Windows app to modify a Linux file stored in a WSL directory you will corrupt the data:
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The easiest way of editing Linux files stored in WSL (Windows Subsystem for Linux) is to use Linux GUI applications. After the initial setup of Ubuntu for Windows 10 is complete you need to install vcxsrv
and Ubuntu desktop. This will give you full access to GUI apps such as gedit
and run scripts that contain GUI dialogs such as zenity
or yad
.
See this answer: What's the easiest way to run GUI apps on WSL as of 2018?
If you use a Windows app to modify a Linux file stored in a WSL directory you will corrupt the data:
The easiest way of editing Linux files stored in WSL (Windows Subsystem for Linux) is to use Linux GUI applications. After the initial setup of Ubuntu for Windows 10 is complete you need to install vcxsrv
and Ubuntu desktop. This will give you full access to GUI apps such as gedit
and run scripts that contain GUI dialogs such as zenity
or yad
.
See this answer: What's the easiest way to run GUI apps on WSL as of 2018?
If you use a Windows app to modify a Linux file stored in a WSL directory you will corrupt the data:
answered May 20 at 17:17


WinEunuuchs2Unix
34.5k756131
34.5k756131
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1038413%2fexport-files-from-ubuntu-wsl%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Which files do you need to edit and why can't they be edited by a Linux program?
â WinEunuuchs2Unix
May 20 at 15:56
1
IMO it is a good question and people new to Linux using WSL are obviously going to be more comfortable and/or expect to manage files / edits with windows tools. At least point them to Linux tools such as nano ;)
â Panther
May 20 at 16:29
Voted to leave open and upvoted existing answer! @Panther
â Fabby
May 20 at 17:11
Close Voters The duplicate candidate spells out how to find out where files are located. OP is not asking where files are located. OP is asking how to edit them using Windows (not possible, but is possible with a Linux GUI app).
â WinEunuuchs2Unix
May 20 at 17:23