Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Lets say I wanted to wildcard directories and then wildcard all files in those directories.

How would I do so?

I know * is to wildcard all files, but I don't know how to wildcard directories.

For example pdf2djvu -o /dir/[wildcard dirs]/[wildcards.djvu] /dir/[wildcard dirs]/[wildcards.pdf]

On a secondary note can such a wildcard be affected if the location had a space where normally typing with "" for spaces it would be better to use \ - this time?

I tried what I posted above using the standard * for the wildcard dirs and wildcard files like /dir[entire dir had no spaces]/*/*.djvu but got the following error

I/O error (basic_ios::clear)

share|improve this question
I should enable globstar if you are using Bash: have a look at what-command-line-to-reliably-traverse-several-directory-levels. –  user76204 Apr 1 '13 at 19:04
ehh that's a bit confusing I enabled globstar then check if it's enabled but * or {**/,} do not work – –  user140393 Apr 1 '13 at 19:42

1 Answer 1

up vote 1 down vote accepted

One possible workaround is to use somethig like:

find . -iname *.pdf | xargs -I% pdf2djvu -o % %.djvu

This would find all pdf files starting in the current directory (recursive) and run the pdf2djvu command to produce file.pdf.djvu files.

share|improve this answer
I get the following error message xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option. I should also mention these files have spaces in them –  user140393 Apr 2 '13 at 9:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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