> For the complete documentation index, see [llms.txt](https://knowledge.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.illumina.com/software/general/software-general-reference_material-list/000003376.md).

# How to download only FASTQs from a BaseSpace project using BaseSpace CLI

The BaseSpace CLI download command coupled with the `--extension fastq.gz` option will download all **FASTQs** stored in the specified **Project**:

```
bs download project -i &lt;ProjectID&gt; -o &lt;Destination&gt; --extension fastq.gz  
```

To download a subset of specific files such as a subset of FASTQ files from a BaseSpace project it is possible to use the `contents` command to list all files, then filter them as desired before downloading. Here is an example way to download all Lane 1 FASTQ files of sample names ending with "Rep1" to the current directory.

Windows:

```
bs contents project -i &lt;ProjectID&gt; -f csv > files-in-project.csv  
findstr /R "Rep1_.*L001.*fastq.gz" files-in-project.csv > filtered-fastqfiles-in-project.csv  
for /f "tokens=1 delims=," %a in (filtered-fastqfiles-in-project.csv) do bs download file -i %a -o . --no-metadata  
```

Unix/Mac:

```
bs contents project -i &lt;ProjectID&gt; -f csv > files-in-project.csv  
grep 'Rep1_.*L001.*fastq.gz' files-in-project.csv > filtered-fastqfiles-in-project.csv  
while IFS=',' read -r first_value rest; do bs download file -i "$first_value" -o . --no-metadata; done < filtered-fastqfiles-in-project.csv  
```

It is possible to filter results directly using `contents` command with combination of exclude and include options

```
bs contents project -i 395620236 -f csv --exclude=* --include=*Rep1_*L001*.fastq.gz > filtered-fastqfiles-in-project.csv  
```

For further information, see [CLI examples](https://developer.basespace.illumina.com/docs/content/documentation/cli/cli-examples#Downloadfilesassociatedwithaproject) page.\
For more information on listing entities, see [How to list BaseSpace entities using BaseSpace CLI](https://github.com/illumina-swi/illumina-knowledge/tree/master/docs/Software/Cloud-Software/Reference_Material/000003682.md)\
For uploading FASTQ or downloading FASTQ files from an input run folder, see [How to upload and download FASTQ files to BaseSpace with BaseSpace CLI](/software/basespace-cli/software-basespace-cli-reference_material-list/000001138.md)

\
\
\ <br>

|                                                                                                                                                                                                                                                                                                                                                                 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| *For any feedback or questions regarding this article (Illumina Knowledge Article #3376), contact Illumina Technical Support* [*techsupport@illumina.com*](mailto:techsupport@illumina.com?subject=Question%2FFeedback%20Regarding%20Illumina%20Knowledge%20Article%20#000003376%20-%20Software%20\&body=Dear%20Illumina%20Technical%20Support,%0D%0A%0D%0A)*.* |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://knowledge.illumina.com/software/general/software-general-reference_material-list/000003376.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
