> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qbraid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Files

> Working with files and directories in qBraid Lab.

## File Browser

The file browser and Files menu enable you to work with files and directories on your system. This includes opening, creating,
deleting, renaming, downloading, and copying files and directories. To open the file browser, click on the "Folder"
icon in the left sidebar (or use shortcut `Cmd+Shift+F`).

The file system can be navigated by double-clicking on folders in the listing or clicking on the folders at the top of the
directory listing. To open any file, double-click on its name, or drag the file into the main work area to create a new tab.

### Show hidden files

Hidden files are those whose names start with a "`.`" (e.g., `.bashrc`, `.gitignore`). These are hidden by default in the file browser to reduce clutter.

From the top-bar menu, click on **View**, and then select **Show Hidden Files** to toggle the visibility of hidden files in
the file browser.

<img src="https://mintcdn.com/qbraidco/MBsWfL_kGPez9EED/v2/lab/_static/hidden-files.png?fit=max&auto=format&n=MBsWfL_kGPez9EED&q=85&s=543c363f659e89e3546397b71971d22a" width="95%" data-path="v2/lab/_static/hidden-files.png" />

### Download files

To download a file, open the file browser, right click on the file, and select **Download** from the context menu.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/MBsWfL_kGPez9EED/v2/lab/_static/download-file.png?fit=max&auto=format&n=MBsWfL_kGPez9EED&q=85&s=d3befb1763e08e741a48698d5287cc0d" width="95%" data-path="v2/lab/_static/download-file.png" />
</div>

### Download directories

Downloading directories is not currently supported by the JupyterLab file browser. However, as a workaround, you can use the
terminal to zip the directory and then download the zip file.

First, open terminal in JupyterLab by opening a Launcher tab and selecting **Terminal** under the **Other** section.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/MBsWfL_kGPez9EED/v2/lab/_static/terminal.png?fit=max&auto=format&n=MBsWfL_kGPez9EED&q=85&s=63b21fa31c289c7064d6c2b87f4dda51" width="95%" data-path="v2/lab/_static/terminal.png" />
</div>

Then, compress the directory using the `zip` command, specifying both the target directory's path and the desired name for the
resulting zip file. The `-r` option is essential as it instructs zip to include all subdirectories and their contents
recursively. The general command format is as follows:

```bash theme={null}
$ zip -r output_filename.zip /path/to/directory
```

Finally, download the zip file using the file browser. See [Download files](#download-files).

## File Sync

If your Lab instance has been inactive for a few days, your files will be restored from cloud storage when you start a new session. A progress indicator appears above the file browser in the left sidebar while the sync is in progress.

<Note>
  Please be patient as your files repopulate — this may take a few moments
  depending on the size of your directory. Once the sync is complete, refresh
  the **Environments** sidebar to see all of your environments again.
</Note>
