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 CSV to JSON
Replace 'csv_file.csv' with your filename.

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

Check your unread Gmail from the command line
notice what happens when there is more than one unread message in a thread... also people please dont hardcode the password when you use curl. Leave it out and curl will ask you when it runs. Please...?

A command to copy mysql tables from a remote host to current host via ssh.
In the example above 3 tables are copied. You can change the number of tables. You should be able to come up with variants of the command by modifying the mysqldump part easily, to copy some part of remote mysql DB.

Send email with one or more binary attachments
This command uses mutt to send the mail. You must pipe in a body, otherwise mutt will prompt you for some stuff. If you don't have mutt, it should be dead easy to install.

Get the serial numbers from HP RAID
This dumps serial numbers of all the drives but HP warranty check does not say they are valid ...

ptree equivalent in HP-UX
By setting the UNIX95 variable in HP-UX the XPG4 mode is activated, you get new options for ps and other commands, for me the best way to use this is to create an alias named ptree in root profile: alias ptree='UNIX95=1 ps -eH'

Generic shell function for modifying files in-place
Some commands (such as sed and perl) have options to support in-place editing of files, but many commands do not. This shell function enables any command to change files in place. See the sample output for many examples. The function uses plain sh syntax and works with any POSIX shell or derivative, including zsh and bash.

Matrix Style
It's the same command as submitted, but first with a command to make all characters green. It's the only way it looked "matrix-like" on my gnome-terminal.

Figure out what shell you're running


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: