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

Ping all hosts on 192.168.1.0/24

Apply, in parallel, a bc expression to CSV
Define a function that applies bc, the *nix calculator, with the specified expression to all rows of the input CSV. The first column is mapped to {1}, second one to {2}, and so forth. See sample output for an example. This function uses all available cores thanks to GNU Parallel. Requires GNU Parallel

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Preview of a picture in a terminal
This command allows you to see a preview of a picture via the terminal. It can be usefull when you are ssh'ing your server without X-forwarding. To have en example of the output you can get with this command see http://www.vimeo.com/3721117 Download at http://inouire.net/image-couleur.html Sources here: http://inouire.net/archives/image-couleur_source.tar.gz

Select rectangular screen area
Hold 'Ctrl' + 'Alt' key while selecting rectangular text area of the screen with left mouse button. Should work in any terminal screen (xterm, konsole, ...) under X, if not then try with 'Ctrl' + 'Shift' + 'Alt' or two-combination of these.

Copy a file structure without files
Taken from: http://www.webmasterworld.com/forum40/1310.htm

Check syntax of all Perl modules or scripts underneath the current directory
Finds all *.p[ml]-files and runs a perl -c on them, checking whether Perl thinks they are syntactically correct

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

Random unsigned integer
works at least in bash. returns integer in range 0-32767. range is not as good, but for lots of cases it's good enough.

Show top 50 running processes ordered by highest memory/cpu usage refreshing every 1s
http://alvinalexander.com/linux/unix-linux-process-memory-sort-ps-command-cpu for an overview of --sort available values


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: