for d in `ls -d *`; do svn status $d | awk '{print $2}'; done | xargs ls -l {} \;

find svn uncommitted files and list their properties

Find all files in SVN workspace directories which are uncommitted. List them and find their properties
Sample Output
-rw-r--r--  1 kdronam    ldap-users  1828 May 26 05:40 hdcmt/demand-tec/scripts/ana.sql
-rwxrwxrwx  1 kdronam    ldap-users 14529 May 26 05:15 hdcmt/demand-tec/scripts/
-rw-r--r--  1 kdronam  hdp-epub   99009 May 23 08:04 hdecirc/pig/Offshore_price_recommendation/pig_1400831817110.log
-rw-r--r--  1 kdronam  hdp-epub   37367 May 22 22:30 hdecirc/working/

By: dronamk
2014-05-27 19:07:45

1 Alternatives + Submit Alt

  • The AWK part of the code will "collate" the fields from 2nd to Nth field (this is to handle any svn directories that may have spaces in them - typical when working with code that is interchangeably used with windows environment - for example, documentation teams) - the output is passed to "ls -ld" - the -d option to ls will tell ls to handle directories itself, rather than do ls on the directory. The '-p' option is just for pretty printing directories, links and executables (for added readability). Finally, the entire "constructed" command will be passed onto sh for shell execution. Show Sample Output

    svn status | awk -F" " '{ for (i=2; i<=NF; i++) print "ls -ld \""$i"\""}' | sh
    kln0thing · 2014-07-09 09:41:24 0

What Others Think

The for statement is an overkill - I am assuming you are at a directory level where current directory is not version controlled, and that there are a bunch of subdirectories from different sources - that being the case, check my alternative command - much tighter and more efficient
kln0thing · 201 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: