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

geoip lookup

c_rehash replacement
When you don't have c_rehash handy. Really simple - if you have a .pem file that doesn't really contain a x509 cert (let's say, newreq.pem), it will create a link, simply called '.0', pointing to that file.

route output as next command's parameters

Find the ratio between ram usage and swap usage.
it provides the ratio used for the RAM and The SWAP under Linux. When swappiness is high, Swap usage is high. When swappiness is low, Ram usage is high.

Generate a random left-hand password
Generates a random 8-character password that can be typed using only the left hand on a QWERTY keyboard. Useful to avoid taking your hand off of the mouse, especially if your username is left-handed. Change the 8 to your length of choice, add or remove characters from the list based on your preferences or kezboard layout, etc.

Get a MySQL DB dump from a remote machine
This command will dump a database on a remote stream to stdout, compress it, stream it to your local machine, decompress it and put it into a file called database.sql.You could even pipe it into mysql on your local machine to restore it immediately. I had to use this recently because the server I needed a backup from didn't have enough disk space.

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

Backup your LDAP
Simple way to backup your LDAP entries: put this line on your crontab. The -n switch identifies the dbnum you want to backup (alternatively you can use -b suffix. Check man slapcat for your personal switches)

Migrate existing Ext3 filesystems to Ext4
Before doing this, back-up all data on any ext3 partitions that are to be converted to ext4. After running previous command you MUST run fsck, is needed to return the filesystem to a consistent state. $ fsck -pDf /dev/yourpartition Edit /etc/fstab and change the 'type' from ext3 to ext4 for any partitions that are converted to ext4.

tmux start new session with title and execute command
in this examp start htop command in tmux session over the shell cosole and set title for the tmux without doing it manuelly in tmux


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: