Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I've got a folder that containes a set of folders that are themselves the root of different projects. Some of these projects are versioned under svn, some are not. I'm looking for a one-liner I can type on the command line to give me a list of those projects that arn't versioned… any ideas?

share|improve this question
up vote 2 down vote accepted

I use 'svn info' to check if a sub directory is under version control. If the tested directory is not a working copy 'svn info' will return with error.
You can redirect output to hide the output of 'svn info'.

I will go on something like the following for iterating directories and if 'svn info' returns with error echo their name.

for D in */; do svn info ${D} &>/dev/null; if [  $? -ne 0 ]; then echo ${D}; fi done

I don't know if you can call it a one-liner but it'll do the work.
Also note that this does not include hidden directories.

share|improve this answer
Nice solution, but wouldn't it be slightly quicker to simply check if there's a .svn subdirectory in each location? – Lèse majesté Apr 9 '12 at 14:35
Works for me :) – Joe Apr 9 '12 at 15:10
@Lèsemajesté It will be, but the '.svn' can be old trash or something else and 'svn info' also validates the working copy to some extent. – amotzg Apr 10 '12 at 7:47

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.