### Commands by SpaceKraken (0) the last day the last week the last month all time sorted by date votes

#### Considering A New Car?

You should consider a Tesla. Get 6 Months Free Supercharging.

### 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.

### Check These Out

Wordwrap long text string using "\n"
I used this fragment with Imagemagick convert so that I can place long text strings in pictures. The "\n" gets converted to a true newline in the image. So this fragment uses fold command to wrap the line and then sed to convert newlines (and any trailing spaces on the line) to the text "\n"

Extract the contents of an RPM package to your current directory without installing them.
This assumes you have the 'rpm', 'rpm2cpio' and 'cpio' packages installed. This will extract the contents of the RPM package to your current directory. This is useful for working with the files that the package provides without installing the package on your system. Might be useful to create a temporary directory to hold the packages before running the extraction: $mkdir /tmp/new-package/; cd /tmp/new-package Duplicating service runlevel configurations from one server to another. And then to complete the task: Go to target host;$ssh host Turn everything off: $for i in chkconfig --list | fgrep :on | awk '{print$1}' ; do chkconfig --level 12345 $i off; done Create duplicate config:$while read line; do chkconfig --level $line on; done < foo Mac OS X: remove extra languages to save over 3 GB of space. This will get the job done in the most efficient way - spawning only one rm process. "On-the-fly" find data is displayed through tee and you should have plenty of time to ctrl-c if needed before it's too late. You may need to re-run this after major Software Updates. To leave more languages in, add more -and \! -iname "lang*"'' statements:$ sudo find / -iname "*.lproj" -and \! -iname "en*" -and \! -iname "spanish*" -print0 | tee /dev/stderr | sudo xargs -0 rm -rfv **Edit: note the 2nd sudo near the end of the pipeline - this is necessary.

Get length of current playlist in xmms2

Dock Thunderbird in system tray and hide main window
Dock Thunderbird in system tray and hide main window. Very useful for startup scripts. Of course you can dock any app of your choice.

Make a DVD ISO Image from a VIDEO_TS folder on MacOSX
/path/ is the root folder of the DVD, not the VIDEO_TS folder.

escape any command aliases
e.g. if rm is aliased for 'rm -i', you can escape the alias by prepending a backslash: rm [file] # WILL prompt for confirmation per the alias \rm [file] # will NOT prompt for confirmation per the default behavior of the command

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"

Human readable directory sizes for current directory, sorted descending