Export files from Ubuntu WSL

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








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







share|improve this question




















  • 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














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







share|improve this question




















  • 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












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







share|improve this question












How can I export files from Ubuntu WSL to windows or any other directory so that I can use/edit that file in windows









share|improve this question











share|improve this question




share|improve this question










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
















  • 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










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/






share|improve this answer





























    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:






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "89"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      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






























      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/






      share|improve this answer


























        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/






        share|improve this answer
























          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/






          share|improve this answer














          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/







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 20 at 16:37

























          answered May 20 at 16:27









          Panther

          74.7k10149256




          74.7k10149256






















              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:






              share|improve this answer
























                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:






                share|improve this answer






















                  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:






                  share|improve this answer












                  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:







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 20 at 17:17









                  WinEunuuchs2Unix

                  34.5k756131




                  34.5k756131






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      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













































































                      Popular posts from this blog

                      GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

                      `kcmshell` modules relation with `/usr/share/applications`

                      How to enroll fingerprints to Ubuntu 17.10 with VFS491