> 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 <ProjectID> -o <Destination> --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 <ProjectID> -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 <ProjectID> -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/articles/Knowledge/Tips-for-listing-BaseSpace-entities-using-BaseSpace-CLI/README.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#000001138%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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
