commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Better awk example, using only mplayer, grep, cut, and awk.
* ps -ef # list running processes
* grep string
* pull the process names from 8th field
* cut and delimiter '/'
* print 4th field
* get rid of trailing grep
* for loop killall -9 $i which is the process name
Why remember? Generate!
Up to 48 chars, works on any unix-like system (NB: BSD use md5 instead of md5sum)
If you don't have html2text
Display the serial of the iPhone (aka UDID).
This command shows a sorted list of the IP addresses from which there have been authentication errors via SSH (possible script kiddies trying to gain access to your server), it eliminates duplicates so it's easier to read, but you can remove the "uniq" command at the end, or even do a "uniq -c" to have a count of how many times each IP address shows in the log (the path to the log may vary from system to system)
Enhancement for the 'busy' command originally posted by busybee : less chars, no escape issue, and most important it exclude small files ( opening a 5 lines file isn't that persuasive I think ;) )
This makes an alias for a command named 'busy'. The 'busy' command opens a random file in /usr/include to a random line with vim.
Command makes use of the Malware Hash Registry (http://www.team-cymru.org/Services/MHR/).
It parses the current directory and subdirectories and calculates the md5 hash of the files, then prints the name and sends the hash to the MHR for a lookup in their database.
The 3rd value in the result is the detection percentage across a mix of AV packages.
Decrypt MD5 , replace 1cb251ec0d568de6a929b520c4aed8d1 with the MD5 string you want to decrypt
Encrypt any text to MD5 , replace text with the string you want to convert to MD5
An alias cannot be executed as command in a find -exec line. This form will trick the command line and let you do the job.
Saves one character, the original is probably clearer
You can also cut charactes starting from X to N.
In case sed and awk are not available you may use this to remove the last character from a string with "rev" and "cut".
This is just a "cut" addicted variant of the previous unixmonkey24730 command...
This works more reliable for me ("cut -c 8-" had one more space, so it did not work)
Expand a URL, aka do a head request, and get the URL. Copy this value to clipboard.