Commands using watch (155)

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

Colorized grep in less
Get your colorized grep output in less(1). This involves two things: forcing grep to output colors even though it's not going to a terminal and telling less to handle those properly.

Replace spaces in filename
This command will replace spaces in filename with underscore, for all file in directory that contain spaces.

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

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"

Purge configuration files of removed packages on debian based systems
Purge all configuration files of removed packages

Sniff ONLY POP3 authentication by intercepting the USER command
dsniff is general purpose password sniffer, it handles *lots* of different protocols, but it also handles tcp-style expressions for limiting analyzed traffic - so I can limit it to work on pop3 only.

Download files linked in a RSS feed
The difference between the original version provided and this one is that this one works rather than outputting a wget error

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.

Compare a remote dir with a local dir
You can compare directories on two different remote hosts as well: $ diff -y

Execute multiple commands from history
Assuming that 219,229 and 221 are entries in history, I recall them in a single line for execute multiple commands 219 ifdown wlan0 ... 221 ifup wlan0 ... 229 iwconfig wlan0 mode Managed so the result is execution of # ifdown wlan0 ; iwconfig wlan0 mode Managed ; ifup wlan0


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: