Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want to cat a file in current folder and all files in all subfolders (and subsubfolders).

Here is my directory structure

$ tree
├── f
│   └── foo
└── yo

I want to cat foo and yo.

I've tried this command but did not work:

cat */*

It just cats foo.

share|improve this question

marked as duplicate by Anthon, slm, manatwork, jasonwryan, Runium May 24 '13 at 9:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Dup. unix.stackexchange.com/q/76418/6622 You search before asking – poige May 24 '13 at 4:51
up vote 5 down vote accepted


   find . -type f -exec cat {} +
share|improve this answer

cat accepts multiple arguments, so you can:

  cat * */*

to cat everything in the current directory and in all subdirectories. You can also

  cat * */* */*/*

and so on, if you want.

Note, of course, that your shell is translating those '*'s into a list of files then passing that whole list to cat.

share|improve this answer
With shopt -s globstar enabled on bash 4+, you can use cat ** instead of the second one. – evilsoup May 25 '13 at 11:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.