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

I hate `echo X | Y`
apart from not being generalisable to all shells, `Y <<< X` seems nicer to me than `echo X | Y`, e.g. $ <<< lol cat; it reads easier, you type less, and it also looks cool

Install pip with Proxy
Installs pip packages defining a proxy

Converts uppercase chars in a string to lowercase
Another alternative is to define a function: lower() { echo ${@,,} } lower StrinG

list block devices
Shows all block devices in a tree with descruptions of what they are.

Create a backup copy of a MySQL database on the same host
This should probably only be used for testing in a dev environment as it's not terribly efficient, but if you're doing something that might trash a DB and you still want the old data available, this works like a charm.

Remove job from crontab by commandline
The "-u USER" is optional if root user is used

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Replace spaces in filenames with underscorees

calulate established tcp connection of local machine
If you want prepend/append text just wrap in echo: $echo Connected: `netstat -an|grep -ci "tcp.*established"`

ubuntu tasksel
The command tasksel allows the choice of packages from the command line to get predefined configurations for specific services (usually this option is offered during installation).


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: