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

Deal with dot files safely

add a gpg key to aptitute package manager in a ubuntu system
when we add a new package to a aptitude (the debian package manager) we need to add the gpg, otherwise it will show warning / error for missing key

Recursively find top 20 largest files (> 1MB) sort human readable format
from my bashrc ;)

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"

resolve hostname to IP our vice versa with less output
inverted version: resolveip -s 216.34.181.xxx freshmeat.net

bash screensaver (scrolling ascii art with customizable message)
Displays a scrolling banner which loops until you hit Ctrl-C to terminate it. Make sure you finish your banner message with a space so it will loop nicely.

create disk copy over the net without temp files
I wanted to create a copy of my whole laptop disk on an lvm disk of the same size. First I created the logical volume: lvcreate -L120G -nlaptop mylvms SOURCE: dd if=/dev/sda bs=16065b | netcat ip-target 1234 TARGET: nc -l -p 1234 | dd of=/dev/mapper/mylvms-laptop bs=16065b to follow its process you issue the following command in a different terminal STATS: on target in a different terminal: watch -n60 -- kill -USR1 $(pgrep dd) (see http://www.commandlinefu.com/commands/view/4356/output-stats-from-a-running-dd-command-to-see-its-progress)

delete file name space
delete file name space the rename is rename perl version

list processes with established tcp connections (without netstat)
Uses lsof to list open network connections (file descriptors), grepping for only those in an established state

Get all IPs via ifconfig


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: