Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Hide

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

Commands using install from sorted by
Terminal - Commands using install - 48 results
yum install fortune-firefly; fortune
apt-get -y install git-core gitosis; adduser --home /home/git --gecos "git user" git; su git -c "ssh-keygen -t rsa -f /home/git/.ssh/id_rsa; gitosis-init < ~/.ssh/id_rsa"
2010-12-19 20:37:12
User: strzel_a
Functions: apt install su
2

After, check if working by executing this command locally :

git clone git@192.168.0.18:repositories/gitosis-admin.git

Tutorial :

http://blog.hemca.com/?p=560

aptitude install '?and(~nlib.*perl, ~Dmodule)'
apt-cache search perl | grep module | awk '{print $1;}' | xargs sudo apt-get install -y
-2

I used this to mass install a lot of perl stuff. Threw it together because I was feeling *especially* lazy. The 'perl' and the 'module' can be replaced with whatever you like.

for p in `grep -v deinstall /var/mobile/Library/Preferences/aptbackup_dpkg-packages.txt | cut --fields=1`; do apt-get -y --force-yes install $p; done
2010-10-11 22:41:55
User: darkfader
Functions: cut install
1

Use when aptbackup will not start or you just want to see what's going on.

dpkg-query -l > 1.lst; sudo apt-get install -y build-essential; ./configure; make; sudo checkinstall -D make install; dpkg-query --list > 2.lst; diff 1.lst 2.lst | grep '^>' | awk '{print $3}' | xargs sudo apt-get remove -y --purge
2010-06-16 22:06:07
User: danlangford
0

on a dpkg managed system this PATTERN will help you generate .deb files from source AND remove all the dev libs you had to install. i hate cluttering up my machine with rouge packages and headers.

it would be pretty darn easy on rpm systems as well. i just dont have a rpm managed system to test on right now.

NOTE, you sharp ones will notice that it uninstalls the deb you just made! yeah, but the deb is still there to do with it what you want, like re install it. or you can just grep -v after the diff

APP=wine; if [ $(sudo apt-get --print-uris -y install $APP | sed -ne 's/^After this operation, \([0-9]\{1,\}\).*MB.*/\1/p') -gt 50 ]; then gnometris 2>/dev/null & sudo apt-get install $APP; else sudo apt-get install $APP; fi
2010-04-18 19:32:26
User: rkulla
Functions: install sed sudo
2

Change the APP variable's value to whatever you want to install. Depending on how fast your machine is, you'll want to adjust the value 50 to something else. You might also want to play a different game than Gnometris - just make sure it's a GUI game.

yum install vixie-cron crontabs
yum -y install bind bind-chroot caching-nameserver
yum install kernel-PAE
brew update && brew install `brew outdated`
apt-get install most && update-alternatives --set pager /usr/bin/most
2010-01-04 14:13:55
User: aurium
Functions: apt install
25

That command installs "most" and make this command as the default man reader. The "most" works like "less" (the current man reader), but it render colors for manpages and may do more things. Read "man most".

You can see a preview here: http://www.dicas-l.com.br/dicas-l/20090718.php

aptitude install bash-completion ; source /etc/bash_completion
2009-10-07 09:27:02
User: flart
Functions: install
3

The really awesome bash completion in debian seems to be an extra package now, which has to be installed. After sourcing /etc/bash_completion it completes almost everything (package names in apt... etc) :-)

To make this permanent, put something like this in your .bashrc:

if [ -f /etc/bash_completion]; then

source /etc/bash_completion

fi

sudo tasksel install lamp-server
2009-09-26 08:15:03
User: sliceoflinux
Functions: install sudo
5

The execution of this command will install a LAMP server (Linux, Apache, MySQL and PHP) in a Debian based distribution. For example, in Ubuntu.

apt-get install sl; sl
2009-09-21 13:55:24
User: alvinx
Functions: apt install
0

this is funny ;)

alias sl="ls" ... is the useful solution, but that's boring ;P and You won't learn to think before You type !

yum --nogpgcheck install "examplePackage"
2009-08-30 18:18:30
User: iDen
Functions: install
-1

Same as:

1 rpm -ivh package.rpm

2 yum localinstall package.rpm

3 Edit /etc/yum.conf or repository.repo and change the value of gpgcheck from 1 to 0 (!dangerous)

sudo apt-get -o Acquire::http::Dl-Limit=25 install <package>
2009-07-31 19:43:45
User: dunnix
Functions: install sudo
Tags: apt-get
4

apt-get is pretty aggressive when it downloads, potentially hogging the bandwidth of your network. The 25 is in KB, change this to your needs.

install -o user -g group -m 0700 -d /path/to/newdir
function dpan () { PKG=`perl -e '$_=lc($ARGV[0]); s/::/-/g; print "lib$_-perl\n"' $1`; apt-get install $PKG; }
2009-03-12 15:39:38
User: dave0
Functions: install
1

Running 'cpan Module::Name' will install that module from CPAN. This is a simple way of using a similar command to install a packaged Perl module from a Debian archive using apt-get.

yum install httpd
2009-02-19 16:59:51
User: sandrader
Functions: install
-30

This command install Apache 2 and other utilities on CentOS

install -o user -g group -m 755 /path/to/file /path/to/dir/
2009-02-18 10:46:19
User: raphink
Functions: install
1

This is useful when you want to copy a file and also force a user, a group and a mode for that file.

Note: if you want to move that file instead of copying it, you can use

install -o user -g group -m 755 /path/to/file /path/to/dir/ && rm -f /path/to/file

which will remove the file only if the install command went fine.

sudo aptitude -y install iasl && sudo cat /sys/firmware/acpi/tables/DSDT > dsdt.dat && iasl -d dsdt.dat
2009-02-15 23:13:50
User: brettalton
Functions: cat install sudo
-1

In July 2008, there was an uproar over Foxconn motherboards feeding Linux installs incorrect ACPI information (http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=869249).

Foxconn has gladly corrected their mistake, but make sure it's not happening on your motherboard!

After running the command, just view the 'dsdt.dsl' in any editor you like.

sudo apt-get install preload
2009-02-13 19:34:57
User: danfernbanck
Functions: install sudo
-7

this application monitors the apps you use most often and load them into memory with their libraries and other dependencies.

So now, when you launch Firefox or Thunderbird or OpenOffice, the display is immediate as on Mac.