Commands using dig (41)

What's this? 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 all links from commandlinefu front page
You need to install WWW::Mechanize Perl module with # cpan -i WWW::Mezchanize or by searching mechanize | grep perl in your package manager With this command, you can get forms, images, headers too

files and directories in the last 1 hour
added alias in ~/.bashrc alias lf='find ./* -ctime -1 | xargs ls -ltr --color'

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"

Download an Entire website with wget

Save xkcd to a pdf with captions
Saves to a PDF with title and alt text of comic. As asked for on Change to for a random comic.

Get your external IP address with a random command
There's been so many ways submitted to get your external IP address that I decided we all need a command that will just go pick a random one from the list and run it. This gets a list of "Get your external IP" commands from and selects a random one to run. It will run the command and print out which command it used. This is not a serious entry, but it was a learning exercise for me writing it. My personal favourite is "curl". I really don't think we need any other ways to do this, but if more come you can make use of them with this command ;o). Here's a more useful command that always gets the top voted "External IP" command, but it's not so much fun: $ eval $(curl -s|sed -n '/^# Get your external IP address$/{n;p;q}')

Archive all folders in a directory into their own tar.bz2 file
Remove the "echo" to actually archive. Many similar commands are found on commandlinefu but I end up needing this very specific one from time to time. To extract any of them, use the standard tar.bz2 extract command: $tar xvjf folder1.tar.bz2

Amazing real time picture of the sun in your wallpaper
Changes the wallpaper for the last IR picture of the sun taken by SOHO satellite. Lesser size, try $ curl | xli -onroot -fullscreen -xzoom 120 -yzoom 120 -border black stdin I use inside kalarm(kde), updating every 15 minutes needs xli , curl

get the oldest file in a directory
reverse the sorting of ls to get the newest file: $ls -1tr --group-directories-first /path/to/dir/ | tail -n 1 Problems: If there are no files in the directory you will get a directory or nothing.

Creating shortened URLs from the command line

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.


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: