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

Securely destroy data on given device hugely faster than /dev/urandom
This command generates a pseudo-random data stream using aes-256-ctr with a seed set by /dev/urandom. Redirect to a block device for secure data scrambling.

List alive hosts in specific subnet
Works on any machine with nmap installed. Previous version does not work on machines without "seq". Also works on subnets of any size.

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

Submit data to a HTML form with POST method and save the response
Assume that you have a form , in the source look for something similar to : input name="rid" type="TEXT" input name="submit" value="SUBMIT" type="SUBMIT" align="center" Then exec the command to get the response into html More info : www.h3manth.com

prettier
Slightly shorter to type

Debug your makefile
Say your dependencies specified in your Makefile (or dates on your source files) is causing 'make' to skip some source-files (that it should not) or on the other other end, if it is causing make to always build some source-files regardless of dates of target, then above command is handy to find out what 'make' thinks of your date v/s target date-wise or what dependencies are in make's view-point. The egrep part removes the extra noise, that you might want to avoid.

Output files without comments or empty lines
Filter comments and empty lines in files. I find this very useful when trying to find what values are actually set in a very long example config file. I often set an alias for it, like : alias nocomment='grep -v "^\($\|#\)"'

Real time duplication of Apache app traffic to a second server
This takes the stream created by apache requests containing jsp and funnels them to another server. I'm using this for simulating real time traffic. The nice command gives ssh maximum CPU cycles, awk & grep strip out everything served by apache. Putting parallel on curl is important because curl is synchronous and waits for the response. Yes, I thought about using wget but it didn't seem any easier. Also, if you figure out how to run this in the background let me know. Every time I background it it stops. If you have multiple front end servers just run multiple instances of this.

Disconnect telnet
You are stuck with testing a tcp port using telnet, and must kill the telnet session from another terminal... Or, press ctrl+5 and write close/quit to force the current connection to close..

Clear terminal Screen


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: