files.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. .. _working_with_files:
  2. Working with Files
  3. ------------------
  4. Opening Files
  5. ~~~~~~~~~~~~~
  6. The file browser and File menu enable you to work with files and
  7. directories on your system. This includes opening, creating, deleting,
  8. renaming, downloading, copying, and sharing files and directories.
  9. The file browser is in the left sidebar Files tab:
  10. .. image:: images/file_menu_left.png
  11. :align: center
  12. :class: jp-screenshot
  13. Many actions on files can also be carried out in the File menu:
  14. .. image:: images/file_menu_top.png
  15. :align: center
  16. :class: jp-screenshot
  17. To open any file, double-click on its name in the file browser:
  18. .. raw:: html
  19. <div class="jp-youtube-video">
  20. <iframe src="https://www.youtube-nocookie.com/embed/Rh-vwjTwBTI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  21. </div>
  22. You can also drag a file into the main area to create a new tab:
  23. .. raw:: html
  24. <div class="jp-youtube-video">
  25. <iframe src="https://www.youtube-nocookie.com/embed/uwMmHeDmRxk?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  26. </div>
  27. Many files types have :ref:`multiple viewers/editors <file-and-output-formats>`.
  28. For example, you can open a Markdown file in a :ref:`text editor <file_editor>` or as rendered HTML.
  29. A JupyterLab extension can also add new viewers/editors for files.
  30. To open a file in a non-default viewer/editor, right-click on its name in the
  31. file browser and use the "Open With..." submenu to select the viewer/editor:
  32. .. raw:: html
  33. <div class="jp-youtube-video">
  34. <iframe src="https://www.youtube-nocookie.com/embed/1kEgUqAeYo0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  35. </div>
  36. A single file can be open simultaneously in multiple viewer/editors and
  37. they will remain in sync:
  38. .. raw:: html
  39. <div class="jp-youtube-video">
  40. <iframe src="https://www.youtube-nocookie.com/embed/87ALbxm1Y3I?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  41. </div>
  42. The file system can be navigated by double clicking on folders in the
  43. listing or clicking on the folders at the top of the directory listing:
  44. .. raw:: html
  45. <div class="jp-youtube-video">
  46. <iframe src="https://www.youtube-nocookie.com/embed/2OHwJzjG-l4?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  47. </div>
  48. Right-click on a file or directory and select "Copy Shareable Link" to
  49. copy a URL that can be used to open JupyterLab with that file or
  50. directory open.
  51. .. image:: images/shareable_link.png
  52. :align: center
  53. :class: jp-screenshot
  54. Creating Files and Activities
  55. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56. Create new files or activities by clicking the ``+`` button at the top
  57. of the file browser. This will open a new Launcher tab in the main work area,
  58. which enables you to pick an activity and kernel:
  59. .. raw:: html
  60. <div class="jp-youtube-video">
  61. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  62. </div>
  63. You can also create new documents or activities using the File menu:
  64. .. image:: images/file_create_text_file.png
  65. :align: center
  66. :class: jp-screenshot
  67. The current working directory of a new activity or document will be the
  68. directory listed in the file browser (except for a terminal, which
  69. always starts in the root directory of the file browser):
  70. .. raw:: html
  71. <div class="jp-youtube-video">
  72. <iframe src="https://www.youtube-nocookie.com/embed/OfISSOTiGTY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  73. </div>
  74. A new file is created with a default name. Rename a file by
  75. right-clicking on its name in the file browser and selecting “Rename”
  76. from the context menu:
  77. .. raw:: html
  78. <div class="jp-youtube-video">
  79. <iframe src="https://www.youtube-nocookie.com/embed/y3xzXelypjs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  80. </div>
  81. Uploading and Downloading
  82. ~~~~~~~~~~~~~~~~~~~~~~~~~
  83. Files can be uploaded to the current directory of the file browser by
  84. dragging and dropping files onto the file browser, or by clicking the
  85. "Upload Files" button at the top of the file browser:
  86. .. raw:: html
  87. <div class="jp-youtube-video">
  88. <iframe src="https://www.youtube-nocookie.com/embed/1bd2QHqQSH4?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  89. </div>
  90. Any file in JupyterLab can be downloaded by right-clicking its name in
  91. the file browser and selecting “Download” from the context menu:
  92. .. raw:: html
  93. <div class="jp-youtube-video">
  94. <iframe src="https://www.youtube-nocookie.com/embed/Wl7Ozl6rMcc?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  95. </div>