---
title: Get the ID of the last 5 draft posts for use in a shell script
description: ```
sqleton wp ls-posts --type blog --status draft --limit 5 --select ID
```

doc_version: 1
last_updated: 2026-07-02
---


To get only the IDs, to reuse them in another context (for example a shell script loop):

```
❯  sqleton wp ls-posts --type blog --status draft --limit 5 --select ID 
635239
76792
471151
262931
79536
```
