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.

Universal configuration monitoring and system of record for IT.

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:



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.

Top Tags



Commands by strzel_a from sorted by
Terminal - Commands by strzel_a - 26 results
pm2 start app.js
2014-11-07 23:15:12
User: strzel_a

I'm the author of PM2 and wrote this tool, and I'm please to share it here.

Github project link: https://github.com/Unitech/pm2

firefox http://emacs.vote-system.com/
ssh -C USER@HOST tar -c --exclude /proc --exclude /sys / | tar -x
cd / ; tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev /
2011-07-20 15:44:07
User: strzel_a
Functions: cd tar

Backup your entire system on a tar ball file format.

locate munin | xargs rm -r
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

After, check if working by executing this command locally :

git clone [email protected]:repositories/gitosis-admin.git

Tutorial :


su - -m -p git
rm !(file_to_keep_undeleted)
2010-12-15 13:31:06
User: strzel_a
Functions: rm

Go to tmp :

cd /tmp; mkdir retmp; cd retmp

Create 10 files :

for i in {1..10}; do touch test$i; done

Remove all files except test10 :

rm !(test10)

find . -name .svn -print0 | xargs -0 rm -rf
wget -O gsplitter.crx "https://clients2.google.com/service/update2/crx?response=redirect&x=id%3Dlnlfpoefmdfplomdfppalohfbmlapjjo%26uc%26lang%3Den-US&prod=chrome&prodversion=8.0.552.224" ; google-chrome --load-extension gspliter.crx
2010-12-14 19:12:18
User: strzel_a
Functions: wget

Download Gsplitter extension, and execute it with Chrome !

Or download it here :


bind '"\t":menu-complete'
export TMOUT=10
2010-11-24 00:04:35
User: strzel_a
Functions: export

Useful in root's .profile - will auto-logout after TMOUT seconds of inactivity.

Close after `seconds` inactive.

export TMOUT=seconds


2010-11-19 17:40:01
User: strzel_a

\$ which python


\$ ll `!!`

lrwxrwxrwx 1 root root 9 2010-11-08 22:01 /usr/bin/python -> python2.6

bind '"\C-l":"ls -l\n"'
2010-11-19 09:14:16
User: strzel_a

Now type Ctrl-l and it will list all files

ls --[TAB][TAB]
2010-11-18 15:31:28
User: strzel_a
Functions: ls

Use it for command like : mkdir, chown, ls, less...

!-2 && !-1
svn add `svn status | grep ? | cut -c9-80`
Esc-/ Esc-/
2010-11-17 23:24:11
User: strzel_a

Shortcut to list files in the current path.

ps ax -L -o pid,tid,psr,pcpu,args | sort -nr -k4| head -15 | cut -c 1-90
function clearIptables(){iptables -P INPUT ACCEPT; iptables -P FORWARD ACCEPT; iptables -P OUTPUT ACCEPT; iptables -F; iptables -X; iptables -L}
ll /root/ 2>&1 | grep -E '(psw|password)'
2010-11-11 23:02:21
User: strzel_a
Functions: grep

2>&1 permit to combinate stdout and stderr.

grep will catch stderr and stdout instead of stdout only.

ping -i1 www.google.com &> /dev/null & disown
2010-11-09 11:22:57
User: strzel_a
Functions: ping

Continue to execute the command in background even though quitting the shell.

cat index.html | sed 's|"index.html%3Ffeed=rss2"|"http://dynamic-blog.hemca.com/?feed=rss2.html"|g'
2010-11-05 20:27:21
User: strzel_a
Functions: cat sed

Pipe | avoid escaping occurences problems in using sed and make it easier to use

add-apt-repository [REPOSITORY]