Commands by paragao (1)

Whenever you compile a new kernel, there are always new modules. The best way to make sure you have the correct modules loaded when you boot is to add all your modules in the modules.autoload file (they will be commented) and uncomment all those modules you need.
Also a good way to keep track of the available modules in your system.
For other distros you may have to change the name of the file to /etc/modprobe.conf
Show Sample Output

This is sample output - yours may be different.

# /etc/modules.autoload.d/kernel-2.6: kernel modules to load when system boots.
#
# Note that this file is for 2.6 kernels.
#
# Add the names of modules that you'd like to load when the system
# starts into this file, one per line. Comments begin with # and
# are ignored. Read man modules.autoload for additional details.
# For example:
# aic7xxx
# mixer-oss.ko
# pcm-oss.ko
# seq-device.ko
# seq-oss.ko
# snd-seq.ko

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

Installing most OSX apps is just a matter of dropping it in /Applications, either GUI-wise or with cp -r. However, many packages are distributed in "mpkg" format, and those have to be installed with an installer. If you don't want to go to the trouble of firing up VNC to install an mpkg, you can use the "installer" command.
This will install an application from a .mpkg it to /Applications system-wide. To install a program for just one user, replace "-target /" with "-target username".

As of this writing, this requires a fairly recent version of util-linux, but is much simpler than the previous alternatives. Basically, lsblk gives a nice, human readable interface to all the blkid stuff. (Of course, I wouldn't recommend this if you're going to be parsing the output.) This command takes all the fun out of the previous nifty pipelines, but I felt I ought to at least mention it as an alternative since it is the most practical.

Prints the unique IP Addresses as they arrive from an Apache `access.log` file.
The '-W interactive' tells awk to start writing to stdout immediately and not buffer the output.
This command builds on the uniq lines without sorting command (http://www.commandlinefu.com/commands/view/4389/remove-duplicate-entries-in-a-file-without-sorting.)

You can display, save and restore the value of $IFS using conventional Bash commands, but these functions, which you can add to your ~/.bashrc file make it really easy.
To display $IFS use the function ifs shown above. In the sample output, you can see that it displays the characters and their hexadecimal equivalent.
This function saves it in a variable called $saveIFS:
$ sifs () { saveIFS=$IFS; }
Use this function to restore it
$ rifs () { IFS=$saveIFS; }
Add this line in your ~/.bashrc file to save a readonly copy of $IFS:
$ declare -r roIFS=$IFS
Use this function to restore that one to $IFS
$ rrifs () { IFS=$roIFS; }

This command takes the content of a Parcellite-managed clipboard manager and add one level of indentation to it. It may be useful to indent a block of code which will enter inside another, already indented one but I use it mostly to indent code I will post in Stack Overflow questions and answers.

I like this better than some of the alternatives using -exec, because if I want to change the string, it's right there at the end of the command line. That means less editing effort and more time to drink coffee.

This will open the manpage for "foobar", and display all instances of "searched_string". You can traverse through them by pressing "n"

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.