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

Get DELL Warranty Information from support.dell.com
pretty much the same. I use awk rather than grep and perl. It looks like the URL has been updated. The service tag can also be retrieved via snmp - potential for a for loop over a list of servers. I might have a look into doing an example.

The simplest way to transport information over a network
Einstein's razor: As simple as possible, but not simpler. On the destination machine netcat listens on any port (1234 in the example) and sends anything it receives into a file or pipe. On the source machine a separate netcat takes input from a file or pipe and sends it over the network to the listener. This is great between machines on a LAN where you don't care about authentication, encryption, or compression and I would recommend it for being simpler than anything else in this situation. Over the internet you should use something with better security.

Start a local web server in the current directory on a random dynamic port.

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

Upgrade all perl modules via CPAN

Download from Rapidshare Premium using wget - Part 1
In order to do that, first you need to save a cookie file with your account info. These commands do it (maybe you need to create the '.cookies' dir before). Also, you need to check the "Direct downloads" option on the Premium Zone >> Settings tab. You need to do this once (as long you maintain the file or your Rapidshare Premium account).

sort the contents of a text file in place.
sorts the contents of a file without the need for a second file to take the sorted output. This was previously entered as `sort -g list.txt -o $_` but as others have pointed out the $_ references the previous command. so this would've worked had that been the second part of a command joined with && like: cat list.txt && sort -g list.txt -o $_ The user below me Robin had the most correct command.

Get a qrcode for a given string

Filter out all blank or commented (starting with #) lines

Remove all the files except abc in the directory
This is for zsh with extended globbing.


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: