Archive for the ‘Tech :: Handy Commands’ Category

How to quickly delete files from Subverseion

Monday, October 22nd, 2007

This is a modification of my quickly add files to Subversion post to allow you to delete files in SVN that have been locally deleted:

$ svn st | grep ^! | cut -b7- | xargs svn delete

Of course, you’ll need to commit the files:

$ svn commit

-Chris

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to remove .SVN directories

Monday, October 15th, 2007

Here’s a handy command for removing .SVN directories as you get ready to launch an application managed by Subversion:

$ find . -name .svn -print | xargs rm -rf {}

-Chris

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to quickly add new files to Subversion

Monday, October 15th, 2007

Quick tip: If you need to add files that are not currently in the repository to SVN, just run the following command from the directory:

$ svn st | grep ^? | cut -b7- | xargs svn add

Of course, you’ll need to commit the files:

$ svn commit

-Chris

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How to count the number of files in a directory

Sunday, October 14th, 2007

I recently needed to count the number of files, not including directories, within a given directory. Additionally, I wanted to count recursively.

On FreeBSD or Linux, you can do this with the following commands:

$ find /path/to/dir -type f | wc -l

Pretty handy!

-Chris

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]