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

Show your account and windows policy settings with Results of Policy msc.
Type this into windows via run and it will display to you your complete policy for windows. This includes group policy, security policy and your active directory account (min password etc).... www.fir3net.com

Install pip with Proxy
Installs pip packages defining a proxy

Copy your ssh public key to a server from a machine that doesn't have ssh-copy-id
This one is a bit more robust -- the remote machine may not have an .ssh directory, and it may not have an authorized_keys file, but if it does already, and you want to replace your ssh public key for some reason, this will work in that case as well, without duplicating the entry.

copy from host1 to host2, through your host
Good if only you have access to host1 and host2, but they have no access to your host (so ncat won't work) and they have no direct access to each other.

Run iMacros from terminal
Run iMacros from terminal

Iterate through current directory + all subs for C++ header files and rank by # of comments
This shows you which files are most in need of commenting (one line of output per file)

fdiff is a 'filtered diff'. Given a text filter and two inputs, will run the filter across the input files and diff the output.
Fdiff will run the command given by the first argument against the input files given as the second and third arguments, and diff the results. It will use 'diff' as the default diff program, but this can be changed by setting $DIFFCMD, e.g. $ export DIFFCMD=vimdiff; $ fdiff zcat 0716_0020005.raw.gz 0716_0030005.raw.gz ... This function will work under bash, but requires the use of command substitution, which is not available under a strict ANSI shell.

Print lines in a text file with numbers in first column higher or equal than a value
A text file contains thousands of numbers. This command prints lines were the number is greater or equal than a specified value (134000000).

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" }

Play radio stream with mplayer
Above command will play Virgin Radio Dubai


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: