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:
change the time that you would like to have as print interval
and just use it to say whatever you want to
You need: pxz for the actual work (http://jnovy.fedorapeople.org/pxz/). The function could be better with better multifile and stdin/out support.
Number of files in a SVN Repository
This command will output the total number of files in a SVN Repository.
Count your source and header file's line numbers
For example for java change the command like this
find . -name '*.java' -exec cat {} \;|wc -l
new way to replace text file with dd,faster than head,sed,awk if you do this with big file
Enhancement for the 'busy' command originally posted by busybee : less chars, no escape issue, and most important it exclude small files ( opening a 5 lines file isn't that persuasive I think ;) )
This makes an alias for a command named 'busy'. The 'busy' command opens a random file in /usr/include to a random line with vim.
Not perfect but working (at least on the project i wrote it ;) )
Specify what you want search in var search, then it grep the folder and show one result at a time.
Press enter and then it will show the next result.
It can work bad on result in the firsts lines, and it can be improved to allow to come back.
But in my case (a large project, i was checking if a value wasn't used withouth is corresponding const and the value is "1000" so there was a lot of result ...) it was perfect ;)
Use this to find identify if dirs mostly contain large or small files.
Downloads the entire file, but http servers don't always provide the optional 'Content-Length:' header, and ftp/gopher/dict/etc servers don't provide a filesize header at all.
Replace .py with .rb or .java to get the LOC of that particular filetype. An alternative is http://www.commandlinefu.com/commands/view/2812/make-a-statistic-about-the-lines-of-code
There's nothing particularly novel about this combination of find, grep, and wc, I'm just putting it here in case I want it again.