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

create shortcut keys in bash

Install a new kernel in Manjaro linux
00 is the number of the linux kernel e.g. linux39

List all available commands (bash, ksh93)

Get an authorization code from Google
This is a basis for other Google API commands.

formatting number with comma
it is not work with Cygwin's bash3.X. Test in Linux. use printf "%'f" number while it is floating point number

Ask for a password, the passwd-style
You can ask repeatedly for a non-blank password using this function: function read_password() { while [ ! -n "$USER_PASSWORD" ]; do read -s -p"Password: " USER_PASSWORD if [ ! -n "$USER_PASSWORD" ]; then echo "ERROR: You must specify a valid password, please try again" fi echo done } Also you can set a time out (in seconds) to write the password read -t 10 -s -p"Password: " USER_PASSWORD_VARIABLE if [ ! $? -eq 0 ]; then echo "Time out!" fi

Download all PDFs from an authenificated website
Replace *** with the appropiate values

Watching Command
If you need to keep an eye on a command whose output is changing, use the watch command. For example, to keep an eye on your load average

Create a simple video contact sheet using the vcs bash script
Assumes you've downloaded Toni Corvera's vcs script (http://p.outlyer.net/vcs), have it in your PATH, and have installed the script's dependencies. Generates a video contact sheet of 24 thumbnails and 3 thumbnails per column. The bold font and white-on-black color scheme keeps the text readable at the chosen 70% JPEG compression quality, which keeps the file size at a manageable level. You can go even lower with the quality and get a good looking result.

for loop with leading zero in bash 3


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: