All commands (14,187)

What's this?

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.

Share Your Commands


Check These Out

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Install pip with Proxy
Installs pip packages defining a proxy

Given process ID print its environment variables
Same as previous but compatible with BSD/IPSO

Stream YouTube URL directly to mplayer
The original doesn't work for me - but this does. I'm guessing that Youtube updated the video page so the original doesn't work.

function to compute what percentage of X is Y? Where percent/100 = X/Y => percent=100*X/Y
This function make it easy to compute X/Y as a percentage. The name "wpoxiy" is an acronym of "what percentage of X is Y"

List recorded formular fields of Firefox
When you fill a formular with Firefox, you see things you entered in previous formulars with same field names. This command list everything Firefox has registered. Using a "delete from", you can remove anoying Google queries, for example ;-)

send a .loc file to a garmin gps over usb
gps data from geocaching.com is provided for free in .loc format.

Check if a machine is online with better UI
I have used single packet, and in a silent mode with no display of ping stats. This is with color and UI improvement to the http://www.commandlinefu.com/commands/view/10220/check-if-a-machine-is-online. It is as per the enhancements suggested.

Boot another OS at next startup

blktrace - generate traces of the i/o traffic on block devices
blktrace is a block layer IO tracing mechanism which provide detailed information about request queue operations up to user space. blkparse will combine streams of events for various devices on various CPUs, and produce a formatted output the the event information. It take the output of above tool blktrace and convert those information into fency readable form.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: