Accepts multiple files via logs...
. Substitute "text to grep" for your search string.
If you want to alias this, you could do something like this:
alias parse-logs='awk "/$1/{print \$1}" ${@[@]:1} | sort -n | uniq -c | sort -rn | head -n 100'
Applies 'docker rm' to all container IDs that appear in 'docker ps -a' but not in 'docker ps' - i.e. the ones that are not running. Show Sample Output
Useful for when you find the system runs out of file descriptors and you want to know why. Show Sample Output
Poor email reputation got you down? Perhaps you're unknowingly forwarding every spam email that makes it through to info@website.com to website@gmail.com. This command outputs every forwarding address set up within a Zimbra installation.
Show top apps that use internet, sorted by count connections and grouped by TYPE and Protocol Show Sample Output
Show what the process are opening many many file descriptos now, we can analyze this for the reason why server is worked slowly. Show Sample Output
How to Free Inode Usage Show Sample Output
Grep for string in all files in a folder, get only the names of the file, making the file list uniq, then assingning all the file names to a variable in awk & printing on STDOUT
Get an approximation of who the workstation is assigned to. You can wrap it in su - "$()" if you want to log into a shell as that user. Show Sample Output
Remove everything after the second "rev" to only display the duplicate filenames and their hashes.
Download all pdf files off of a website using wget. You can change the file type to download, changing the extension, as an example you can change pdf for txt in command. Show Sample Output
Outputs unique error messages from the apache log, sorted by frequency. Tested on log format: [Wed Aug 26 00:00:00 2015] [error] [client xx.xx.xx.xx] Error message here Show Sample Output
finds all xml files greps them for extracts the bean id sorts the ids creates a list of distinct entries, a unique list of bean ids Show Sample Output
Count the number of unique colors there are in a websites css folder (136 is way too many imho time to get people stick to a color scheme) Show Sample Output
I used this to resolve runtime dependencies of an application to create self-contained tar-balls (e.g. PHP for Docker or Rkt) Requirements: - realpath - ldd - find - grep - sort - uniq - xargs
Replace thread_link with the link of the thread you want to download images of.
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: