get desired info from machine and pipe it txt file. Show Sample Output
this command searches for a keyword or an expression in a path and avoids versionned files
grep's -c outputs how may matches there are for a given file as "file:N", cut takes the N's and awk does the sum. Show Sample Output
The same as the other user, but smarter, using -d and -f
Not as far off as you thought, now is it? -mac fanboy Show Sample Output
regex to match an ip Show Sample Output
See external ip with w3m, simple and fast. On a web site from Chile (spanish).
Must have the video open and fully loaded.
It's not a big line, and it *may not* work for everybody, I guess it depends on the detail of access_log configuration in your httpd.conf. I use it as a prerotate command for logrotate in httpd section so it executes before access_log rotation, everyday at midnight.
Sometimes I need a quick visual way to determine if there is a particular server who is opening too many connections to the database machine.
Require ips and ipcalc Show Sample Output
Get the line containing "inet addr:" and the line before that, get down to only the first line, and then get the first word on that line, which should be the interface. Show Sample Output
The '[r]' is to avoid grep from grepping itself. (interchange 'r' by the appropriate letter)
Here is an example that I use a lot (as root or halt will not work):
while (ps -ef | grep [w]get); do sleep 10; done; sleep 60; halt
I add the 'sleep 60' command just in case something went wrong; so that I have time to cancel.
Very useful if you are going to bed while downloading something and do not want your computer running all night.
xargs deals badly with special characters (such as space, ' and "). To see the problem try this: touch important_file touch 'not important_file' ls not* | xargs rm Parallel https://savannah.nongnu.org/projects/parallel/ does not have this problem.
Usefull if you want to check if something is applying a dictonary of brute force.
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: