> For the complete documentation index, see [llms.txt](https://abhav.gitbook.io/linux-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abhav.gitbook.io/linux-tutorials/xargs.md).

# xargs

converts from \`stdin\` to command line arguments

Some commands accept command line arguments only, so we have to use `xargs` in order to achieve the desired result

```sh
For example

cat filenames.txt | echo
```

The wouldnt execute without `xargs` as `echo` accepts command line arguments only

<figure><img src="https://3197044210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwGS99FW5vqaPqYTGiSZC%2Fuploads%2FeQTp134PkQilpr82jBLB%2FScreenshot%202024-01-13%20at%205.23.20%E2%80%AFAM.png?alt=media&amp;token=204ee251-40bc-42e6-bcd7-b5d83e31d01a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3197044210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwGS99FW5vqaPqYTGiSZC%2Fuploads%2FYPGLip7XRb7oyvRe6MQQ%2FScreenshot%202024-01-13%20at%205.23.38%E2%80%AFAM.png?alt=media&amp;token=01d4ac0a-281c-40b1-90f1-70fb1eef79c6" alt=""><figcaption></figcaption></figure>

### Create files given in a file called \`filenames.txt\`&#x20;

```sh
cat filenames.txt | xargs touch 
```

<figure><img src="https://3197044210-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwGS99FW5vqaPqYTGiSZC%2Fuploads%2FMZSSHBnwhYuFyddDkull%2FScreenshot%202024-01-13%20at%205.24.49%E2%80%AFAM.png?alt=media&amp;token=60cf0d7d-f454-4275-aced-78cdbf627c61" alt=""><figcaption></figcaption></figure>
