Commands by joeheyming (4)

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

Prints new content of files
Useful to e.g. keep an eye on several logfiles.

Delete all but the latest 5 files, ignoring directories

scping files with streamlines compression (tar gzip)
it compresses the files and folders to stdout, secure copies it to the server's stdin and runs tar there to extract the input and output to whatever destination using -C. if you emit "-C /destination", it will extract it to the home folder of the user, much like `scp file user@server:`. the "v" in the tar command can be removed for no verbosity.

pipe output to notify-send
Route output to notify-send to show nice messages on the desktop, e.g. title and interpreter of the current radio stream

Destroy all disks on system simultaneously
This command will use the fdisk utility to find all block devices on your system, and overwrite them with data from the /dev/urandom non-blocking random number generator. CAUTION: This will irrevocably erase EVERY SINGLE physical block storage device visible to the fdisk utility, including plugged USB devices, RAID sets, LVM, etc.

Arch Linux: Always install software without asking
Adding this alias to ~/.bashrc or, better yet, the system-wide /etc/bash.bashrc (as in my setup) will make it possible to not only run pacman as any user without needing to prepend sudo but will also ensure that it always assumes that the user knows what he or she is doing. Not the best thing for large multi-user enterprise setups at all to say the least, but for home (desktop) use, this is a fantastic time-saver.

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"

A command's package details
In Debian based distros, this command will list 'binutils' package details which contains 'nm' command. You can replace 'nm' to any other command.

Backup your OpenWRT config (only the config, not the whole system)
You only have to fill in your administrative account and password, and the router FQDN! I recommand to execute this command not over the internet, because there is no encryption (the username and password will be transmitted in plaintext!)

locate bin, src, and man file for a command


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: