This command allows you to revert every modified file one-by-one in a while loop, but also after "echo $file;" you can do any sort of processing you might want to add before the revert happens. Show Sample Output
cut -f1,2 - IP range 16 cut -f1,2,3 - IP range 24 cut -f1,2,3,4 - IP range 24 Show Sample Output
Create a bash function for easy reference webPassword() { echo $1 $2 | md5sum | awk '{print substr($0,0,10)}' } alias webpwd=webPassword Use like this. webpwd www.commandlinefu.com MyPetNameHere Show Sample Output
more variety
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. When i saw the command i had some ideas to make it shorter. Here is my version.
You can execute this inside an editor to get all the fields inside your buffer and do the magic, really usefull when your tables contain a giant list of fields. Show Sample Output
Depending on your Apache access log configuration you may have to change the sum+=$11 to previous or next awk token. Beware, usually in access log last token is time of response in microseconds, penultimate token is size of response in bytes. You may use this command line to calculate sum and average of responses sizes. You can also refine the egrep regexp to match specific HTTP requests. Show Sample Output
If there are spaces won't work.
Allows to change 'shell' compatible files execution bit even if their name is not *.sh
Okay, commands like this are a bit of a personal peeve. awk(1) operates on a /pattern/ {action} paradigm and yet I see people leave out the /pattern/ portion of an awk command all the time, opting to use grep or sed instead. You'll save yourself some typing and time if you include the /pattern/ with your {action}.
grep -e "[sh]d[a-l]$" /proc/partitions | awk '{print $4}' # for disks only grep -e "[sh]d[a-l][0-9]\+" /proc/partitions | awk '{print $4}' # for partitions only Show Sample Output
Linux only Show Sample Output
The command will make it easy to determine free IP ranges in a crowded sub-net. Show Sample Output
I came up with this because I don't have a problem remembering the big major changes I made deep inside my tree for a specific feature or bugfix but always manage to forget the trivial stuff I tweaked or touched along the way that needs to get pushed as well. Show Sample Output
Uses the --porcelain option, which is garanteed to be stable among git versions and configurations - also, is way easier to parse. Show Sample Output
Get the current cpu % usage on your system. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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: