Function that searchs a process by its name and shows in the terminal. * Shows the Header for reference * Hides the process 'grep' from the list * Case sensitive Show Sample Output
Add -n to last command to restrict to last num logins, otherwise it will pull all available history. Show Sample Output
display IP's that unsuccessfully attempted to login 5 or more times today may want to filter any trusted IP's and the localhost useful for obtaining a list IP addresses to block on the firewall Show Sample Output
You could have that little benchmark run on all cores in parallel, as a multi-core benchmark or stress test First find the number of cores, then have parallel iterate over that in, well, parallel Show Sample Output
Where is my Apache public_html ?!
Select only the files with given name and copy them to /tmp/ folder.
Variant of find grep that ignores files with .svn in the name. Useful for searching through a local repository of source code.
Probably posted previously, I use this all the time to find and kill a process for "APP". Simply replace "APP" with the name of the process you're looking to kill.
The description of how the one-liner works is here at my blog: http://jugad2.blogspot.com/2008/09/unix-one-liner-to-kill-hanging-firefox.html Show Sample Output
checking files in current and sub directories, finding out the files containing "sampleString" and removing the containing lines from the file. * Beware that The command will update the original file [no backup]. The command can be extended if play with 'find' command together, e.g. it is possible to execute on certain type of files: *.xml, *.txt... (find -name "*.xml" | grep....) if anybody knows a better solution on that, please drop a comment. thx.
This is the simple revision number on stdout, that can be fed to any useful/fun script of yours. Setting LC_ALL is useful if you use another locale, in which case "Revision" is translated and cannot be found. I use this with doxygen to insert my source files revisions into the doc. An example in Doxyfile: FILE_VERSION_FILTER = "function svn_filter { LC_ALL=C svn info $1 | grep Revision | awk '{print $2}'; }; svn_filter" Share your ideas about what to do with the revision number ! Show Sample Output
Useful to check DDoS attacks on servers. Show Sample Output
If the 'lm' flag is present, then the CPU is 64-bit. If no output, then CPU is 32-bit. Show Sample Output
Searches /var/log/secure for smtp connections then lists these by number of connections made and hosts.
Replace "en1" with your network interface (on OS X, usually en0, en1, eth0, etc..) Show Sample Output
Greps located files for an expression.
Example greps all LaTeX files for 'foo':
locate *.tex | xargs grep foo
To avoid searching thousands of files with grep it could be usefull to test first how much files are returned by locate:
locate -c *.tex
This expression looks for groups inside of a GroupOfNames class element, that is itself inside one (or many) Organizational Unit (ou) nodes in the ldap tree. Give you a quick dump of all the groups the user belongs to. Handy for displaying on a webpage. 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: