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 - 43 results
yum install php-tidy
sudo apt-get install ffmpeg libavcodec-extra-53
brew install ssh-copy-id; ssh-copy-id user@host
cabal update && cabal install pandoc
2013-08-25 14:25:43
User: Romero
Functions: install
1

An alternative to built-in package manager, keep pandoc in sync with upstream releases.

cat -n install | head -n 150 | tac | head -n 50 | tac
sudo apt-get install linux-headers-`uname -r`
2013-04-18 03:18:26
User: farazyashar
Functions: install sudo
2

Install the Linux kernel headers for currently running kernel version on Debian-based systems via apt-get

sudo apt-get install git gcc make libx11-dev libxtst-dev pkg-config -y && git clone https://github.com/hanschen/ksuperkey.git && cd ksuperkey && make && sudo mv ksuperkey /usr/bin/ksuperkey && cd ~ && rm -rf ksuperkey
2013-04-17 07:12:46
User: FadeMind
Functions: cd gcc install make mv rm sudo
0

Install Ksuperkey one command in Kubuntu.

You must manually add ksuperkey to autostart in System Settings KDE.

apt-get install phpmyadmin; echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf; service apache2 restart
2013-04-06 16:20:55
User: ZEROF
Functions: apt echo install
0

This command will install phpmyadmin, set apache2 server and restart apache2. After running this command you can open phpmyadmin on http://yoursite.com/phpmyadmin

sudo apt-get install lamp-server^ phpmyadmin
dpkg --list | rgrep ii | cut -d" " -f3 | sed ':a;N;$!ba;s/\n/ /g' | sed 's/^\(.\)/apt-get install \1/'
sudo apt-get install aptitude
yum install zsh
2012-04-02 12:53:30
User: netaxiz
Functions: install
-21

Use ZSH instead of bash, typing .. will move you up one directory, without the need to alias it.

find ~/path/to/apk/files -name '*.apk' -exec adb install {} \;
2012-02-16 03:59:44
Functions: find install
Tags: find adb
0

You must have the android sdk installed with 'adb' executable on your system. This is just a way to loop over files in a folder using 'find' to locate and install android apps.

sudo env ARCHFLAGS="-arch x86_64" gem install mysql
apt-get install `ssh root@host_you_want_to_clone "dpkg -l | grep ii" | awk '{print $2}'`
$sudo aptitude install python-virtualenv; virtualenv --no-site-packages jpaenv; source jpaenv/bin/activate
function command_not_found_handle(){ apt-get install $( apt-file search "$1" | grep bin | grep -w "$1" | head -n1 | cut -d ':' -f 1 ) && $* ; }
2011-04-06 19:58:32
User: Juluan
Functions: cut grep head install
-7

Work only with bash and apt-file installed.

When it found an unknow command, it will search for a file named "scribus" (in my example), in a folder named bin and then install the corresponding package.

After installation, it will run the command.

Usefull juste after reinstalling linux and missing lot of package.

sudo apt-get install linux-headers-$(uname -r)
sudo -i; add-apt-repository ppa:webupd8team/sublime-text-2; apt-get update; apt-get install sublime-text-2
2011-03-16 23:57:41
User: xmonkey
Functions: install sudo
-7

This is the first version of the Sublime Text 2 packaging so there might be bugs.

<command> >NUL 2>&1 || ( echo <Command> not found. Please install <command> or check PATH variable! & pause & exit )
2011-03-07 14:27:42
User: Marco
Functions: echo exit install
Tags: windows batch dos
2

This is a command to be used inside of MS-DOS batch files to check existence of commands as preconditions before actual batch processing can be started. If the command is found, batch script continues execution. If not, a message is printed on screen, script then waits for user pressing a key and exits.

An error message of the command itself is suppressed for clarity purpose.

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.