Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Hide

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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

gets all files committed to svn by a particular user since a particular date

Terminal - gets all files committed to svn by a particular user since a particular date
svn log -v -r{2009-05-21}:HEAD | awk '/^r[0-9]+ / {user=$3} /yms_web/ {if (user=="george") {print $2}}' | sort | uniq
2009-06-05 14:07:28
User: jemptymethod
Functions: awk sort
4
gets all files committed to svn by a particular user since a particular date

just change the date following the -r flag, and/or the user name in the user== conditional statement, and substitute yms_web with the name of your module

Alternatives

There are 3 alternatives - vote for the best!

Terminal - Alternatives
svn log -v -r{2009-11-1}:HEAD | awk '/^r[0-9]+ / {user=$3} /./{if (user=="george") {print}}' | grep -E "^ M|^ G|^ A|^ D|^ C|^ U" | awk '{print $2}' | sort | uniq
2011-12-05 07:36:44
User: smilyface
Functions: awk grep sort
Tags: svn awk log
0

svn log -v --> takes log of all

Filter1

--------

-r {from}{to} --> gives from and to revision

Filter2

--------

awk of line 'r'with numbers

Assign user=3rd column [ie; username]

Filter3

--------

if username = George

print details

Filter4

--------

Print lines starts with M/U/G/C/A/D

[* A Added * D Deleted * U Updated * G Merged * C Conflicted]

Filter5

--------

sort all files

Filter6

-------

Print only uniq file's name alone.

Know a better way?

If you can do better, submit your command here.

What others think

OMG! Thanks man, for this peace of heaven. This command save my life (ok, but save hours of work).

Congrats!

Comment by lawrence 267 weeks and 6 days ago

Here is a shell for this. I just made for my usage. May be helpful for u too. The before told command itself i used , but with details of commit also included.

Do as follows.

create a file

vi svn_get_user_committed_files_details.sh

press i

then copy & paste the following as it is. And then make the shell executable with the command chmod.

[Don't forget to change PROJECT path. :)]

#!/bin/bash

PROJECT="/home/smily/workspace/MyProj"

svnfile_log_all="/tmp/svnfile_log_all.txt"

svnListUNames="/tmp/svnListUNames.txt"

svnUserCommitted="/tmp/svnUserCommitted.txt"

uName="$1"

[ -f $svnfile_log_all ] && rm -f $svnfile_log_all

[ -f $svnListUNames ] && rm -f $svnListUNames

[ -f $svnUserCommitted ] && rm -f $svnUserCommitted

echo -e "\nPlease wait..\n"

svn log -v $PROJECT > $svnfile_log_all

if [ -z $uName ]; then

cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./ {print user} ' | grep -v "^$" |sort | uniq >> $svnListUNames

else

if [ `cat $svnfile_log_all | grep "$uName" | wc -l` -gt "0" ]; then

echo $uName > $svnListUNames

else

echo -e "\n>>>>>user: $uName not committed any files.

exit 0

fi

fi

echo -e "\n\nRepo Name: `cat $PROJECT/.svn/entries | grep "

while read uName

do

echo -e "$uName committed files\n======================" >> $svnUserCommitted

cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' | grep -E "^ M|^ G|^ A|^ D|^ C|^ U" | awk '{print $2}' | sort >> $svnUserCommitted

echo -e "\n\nIn Detail:\n==========" >> $svnUserCommitted

cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' >> $svnUserCommitted

echo -e "\n"

done < $svnListUNames

echo -e "Log is in : $svnUserCommitted\n"

cat $svnUserCommitted

Comment by smilyface 148 weeks and 1 day ago

A shell script for doing this kind of defeats the purpose of command line fu

Comment by jemptymethod 148 weeks and 1 day ago

Your point of view

You must be signed in to comment.

Related sites and podcasts