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

lazy SQL QUERYING
This is regarding the command 8263 using an alias to fill in command line options for psql. You can actually just type 'psql'. In order for that to work, you want to set environment variables PGDATABASE, PGHOST, PGUSER, and (except you're using the default) PGPORT. Also, you can add a line "host:port:dbname:user:password" (asterisk ok in some columns) to your ~/.pgpass file. Finally, if you don't like the aligned columns, you can add the line "\pset format unaligned" to your ~/.psqlrc file.

List apache2 virtualhosts
Lists virtualhosts currently enabled for apache2, showing the ServerName:port, conf file and DocumentRoot

copy hybrid iso images to USB key for booting from it, progress bar and remaining time are displayed while copying

generate random number

HTTP GET request on wireshark remotly

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"

Show in a web server, running in the port 80, how many ESTABLISHED connections by ip it has.
The command could show you all conecctions if you skip "grep ESTABLISHED"

To find which host made maximum number of specific tcp connections
This command is primarily going to work on linux boxes. and needs to be changed, for example IP=10\.194\.194\.2 PORT=389

Get list of servers with a specific port open
Change the -p argument for the port number. See "man nmap" for different ways to specify address ranges.

Daemonize nc - Transmit a file like a http server
Allow to launch nc like a daemon, in background until you still stop it. You can stop it with kill %1 (jobs method) or kill PID. The -k option can force nc to listen another connection, but if you use redirection, it will work only one time. The loop's inside doesn't do anything, but we can imagine to send a message to screen when a connection is established


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: