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/
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.
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
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:
command to find out the unused SVN repositories from the server via svnlook. This lists the when the last commit (HEAD revision) has happened in the repository.
Emulate (more or less) Git equivalent of
git log --format='tformat:%h %an (%cr) %s'
first need to Edit the configuration file
/home/cicciobomba/.subversion
and under the [tunnels] add this line
ciccio_diverso = /usr/bin/ssh -p 12345
Number of files in a SVN Repository
This command will output the total number of files in a SVN Repository.
* Replace USERNAME with the desired svn username
* Replace the first YYYY-MM-DD with the date you want to get the log (this starts at the midnight event that starts this date)
* Replace the second YYYY-MM-DD with the date after you want to get the log (this will end the log scan on midnight of the previous day)
Example, if I want the log for December 10, 2010, I would put {2010-12-10}:{2010-12-11}
If you would like to ignore a directory including its subdirectory. For example, a tmp/ directory
If you have a directory with many working copies of various subversion projects and you want to update them all at once, this one may be for you.
If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server.
The above command will set the GID bit on all directories named .svn in the current directory recursively. This makes the group ownership of all .svn folders be the group ownership for all files created in that folder, no matter the user.
This is useful for me as the subversion working directory on my server is also the live website and needs to be auto committed to subversion every so often via cron as well as worked on by multiple users. Setting the GID bit on the .svn folders makes sure we don't have a mix of .svn metadata created by a slew of different users.
When browsing java source code (for example) it's really annoying having to type the first letter of the package when there is only one package in the subdir.
man bash for more info about FIGNORE
This command will output the total number of files in a SVN Repository.
Improvement of the command "Find Duplicate Files (based on size first, then MD5 hash)" when searching for duplicate files in a directory containing a subversion working copy. This way the (multiple dupicates) in the meta-information directories are ignored.
Can easily be adopted for other VCS as well. For CVS i.e. change ".svn" into ".csv":
find -type d -name ".csv" -prune -o -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type d -name ".csv" -prune -o -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate