commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
* 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.
Videos are found using their MIME type. Thus no need to for an extension for the video file.
This is a efficent version of "jnash" cmd (4086). Thanks for jnash. This cmd will only show video files while his cmd show files having "video" anywhere in path.
Grabs the Apache config file (yielded from httpd) and returns the path specified as DocumentRoot.
attempts to delete all local branches. git will fail on any branches not fully merged into local master, so don't worry about losing work. git will return the names of any successfully deleted branches. Find those in the output with grep, then push null repositories to the corresponding names to your target remote.
- your local and remote branches are identically named, and there's nothing extra in the remote branch that you still want
- EDIT: you want to keep your local master branch