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:
This one is tried and tested for Ubuntu 12.04. Works great for tailing any file over http.
Emulate (more or less) Git equivalent of
git log --format='tformat:%h %an (%cr) %s'
Commandline perl filter for, using a production.log from a rails app, display on realtime the count of requests grouped by "seconds to complete" (gross round, but fair enough for an oneliner) :)
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.
This is a more concise answer to http://blog.commandlinekungfu.com/2011/09/episode-158-old-switcheroo.html in my opinion.
This command are using by me for checking connection with Internet.
Fetch comical VC commit messages from whatthecommit.com
Requires html2text. Print bad, but often funny commit messages from whatthecommit.com
DO NOT RUN this command! THIS WILL CHECK IN ALL CHANGES IN THE CURRENT DIRECTORY TO SUBVERSION WITH A TERRIBLE COMMIT MESSAGE!!!!!!!!!!!!!!! DON'T DO IT! YOU'VE BEEN WARNED!
Fetch comical VC commit messages from whatthecommit.com
* 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}
GoAccess is an open source real-time Apache web log analyzer and interactive viewer that runs in a terminal in *nix systems. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. http://goaccess.prosoftcorp.com/
When debugging an ssh connection either to optimize your settings ie compression, ciphers, or more commonly for debugging an issue connecting, this alias comes in real handy as it's not easy to remember the '-o LogLevel=DEBUG3' argument, which adds a boost of debugging info not available with -vvv alone.
Especially useful are the FD info, and the setup negotiation to create a cleaner, faster connection.
GoAccess is an open source real-time Apache web log analyzer and interactive viewer that runs in a terminal in *nix systems. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. http://goaccess.prosoftcorp.com/
urls.txt should have a fully qualified url on each line
prefix with
rm log.txt;
to clear the log
change curl command to
curl --head $file | head -1 >> log.txt
to just get the http status
Returns logs between HH:M[Mx-My], for example, between 13:40 and 13:45.
Uses date to grep de logfile for today and uses it to get the last hour logs. Can be used to get last minute logs or today's logs.
This command will return a full list of Error 404 pages in the given access log. The following variables have been given to awk
Hostname ($2), ERROR Code ($9), Missing Item ($7), Referrer ($11)
You can then send this into a file (>> /path/to/file), which you can open with OpenOffice as a CSV
This awk command prints a histogram of the number of times 'emergency' is the first word in a line, per day, in an irssi (IRC client) log file.
This awk command prints a histogram of the number of times 'emergency' is the first word in a line, per day, in an irssi (IRC client) log file.