This is from perldoc -q random.*line, which says: This has a significant advantage in space over reading the whole file in. You can find a proof of this method in The Art of Computer Programming, Volume 2, Section 3.4.2, by Donald E. Knuth. Who am I to argue with Don Knuth?
Can also just use the debug mode like this. Show Sample Output
Replace PACKAGE with desired package name. Found here: http://mikebeach.org/2011/04/undo-apt-get-build-dep/
Recursively delete empty directories. Use with care.
this command example converts to 25 fps subtitles that were originally created for 24 fps movie
Calls the POSIX strerror() function to look up the meaning of integer ERRNOs set by some functions.
from http://stackoverflow.com/questions/1030787/multiline-search-replace-with-perl added greedy trick in wildcard match (.*?) from http://www.troubleshooters.com/codecorn/littperl/perlreg.htm#Greedy Show Sample Output
the output of svn log is annoying to grep, since it spreads the useful info over multiple lines. This compacts the output down to one line so eg you can grep for a comment and see the rev, date & committer straight away. Updated: MUCH shorter, easier to remember. Now it just replaces newlines with spaces, except on '---' lines. Show Sample Output
The crypt function takes a password, key, as a string, and a salt character array which is described below, and returns a printable ASCII string which starts with another salt. It is believed that, given the output of the function, the best way to find a key that will produce that output is to guess values of key until the original value of key is found. from http://en.wikipedia.org/wiki/Crypt_(Unix)
This one line Perl script will display the smallest to the largest files sizes in all directories on a server. Show Sample Output
Requires perl 5.14 or greater
This prints file access rights in octal - useful when "stat" is unavailable. Show Sample Output
extract data in multiline blocks of data with perl pattern matching loop Show Sample Output
Really helpfull when play with files having spaces an other bad name. Easy to store and access names and path in just a field while saving it in a file. This format (URL) is directly supported by nautilus and firefox (and other browsers) Show Sample Output
Sets the @ A record for your domain hosted by namecheap to your current internet-facing IP address, logs success or failure with syslog, and logs the data returned to /root/dnsupdate. Change the XXX's as appropriate. More info at: http://www.namecheap.com/support/knowledgebase/article.aspx/29/ Show Sample Output
Use it to send raw data to a networked device. Used to interact with relay controller board whose documentation is lost, so use wireshark to sniff the sent data and replayed using the command.
Converts control codes and spaces (ASCII code ≤ 32) to visible Unicode Control Pictures, U+2400 ? U+2420. Skips \n characters, which is probably a good thing. Show Sample Output
An advantage is that this doesn't modify remained string at all. One can change {0,1} with {0,n} to drop several columns
Better than the others, and actually works unlike some of them. Show Sample Output
Based on http://stackoverflow.com/questions/13127352/checking-alternative-names-for-a-san-ssl-cert Replace "facebook.com" with the desired hostname. 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: