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.
ipscore <your ip>
number
ipscore 186.78.151.135
2
a high score represents a bad remote address (honeypot, tor, botnet..)
Show Sample Output
This approach deals with special characters such as apostrophe and whitespace in the file/directory names. tr '\n' '\0' converts the newline delimiting into NUL delimitering which xargs -0 expects. It works on systems which do not yet support xargs -d or sort -h, and includes files in addition to directories. Show Sample Output
display dd status on OSX (coreutils) every 10 seconds Show Sample Output
This will look in all binary and library files in package and then search the system for this library and then print the required package that has this file, this depends on /etc/prt-get.conf prtdir order. finddeps is a prt-utils script for http://crux.nu/ CRUX Linux. If you use docker you can try this out with "docker run -i -t crux" Show Sample Output
https://www.magnatune.com depends on unp but does not need to but unp is the easiest way to unpack any archive. it's in Debian repo's. !note: it deletes flac zip when done, if successful. Show Sample Output
In the field, I needed to script a process to scan a specific vendor devices in the network. With the help of nmap, I got all the devices of that particular vendor, and started a scripted netcat session to download configuration files from a tftp server. This is the nmap loop (part of the script). You can however, add another pipe with grep to filter the vendor/manufacturer devices only. If want to check the whole script, check in http://pastebin.com/ju7h4Xf4 Show Sample Output
Tells you where's left and right. Handy if you can't ever remember them. Show Sample Output
Useful for big systems with lots of cards. (Update: does not work with USB disks)
Just 253 chars of pure UNIX magic, with curl. I created this contrived bash one-liner while building a command-line bash game : www.rubegoldbash.com. Show Sample Output
Finds the date of the first commit in a git repository branch Show Sample Output
This helps me determine which repo I want to use for downloading ISO files Show Sample Output
How to Free Inode Usage Show Sample Output
Rearrange pdf document coming from a simplex document feed scanner, feeded first with odd pages, then with even pages from the end. Needs pdftk >1.44 w/ shuffle. Similar to http://www.commandlinefu.com/commands/view/7965/pdf-simplex-to-duplex-merge where there are 2 separate documents, odd and even
Removes directories which are less than 1028KB total. This works for systems where blank directories are 4KB. If a directory contains 1 MB (1024KB) or less, it will remove the directory using a path relative to the directory where the command was initially executed (safer than some other options I found).
Adjust the 1028 value for your needs.
It would be helpful to test the results before proceeding with the removal. Simply run all but the last two commands to see a list of what will be removed:
du | awk '{if($1<1028)print;}' | cut -d $'\t' -f 2-
If you're unsure what size a blank folder is, test it like this:
mkdir test; du test; rmdir test
For OS X/bsd; probably messy
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
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: