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.


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

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Commands by strzel_a from sorted by
Terminal - Commands by strzel_a - 27 results
pm2 install pm2-webshell
2015-06-11 12:43:49
User: strzel_a
Functions: install
-11

pm2 is a process manager that includes a module system to install powerful and small softwares

pm2 start app.js
2014-11-07 23:15:12
User: strzel_a
0

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 [email protected] 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
0

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
2

After, check if working by executing this command locally :

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

Tutorial :

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

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

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
-3

Download Gsplitter extension, and execute it with Chrome !

Or download it here :

https://chrome.google.com/extensions/detail/lnlfpoefmdfplomdfppalohfbmlapjjo

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

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

Close after `seconds` inactive.

export TMOUT=seconds

(unefunge)

`!!`
2010-11-19 17:40:01
User: strzel_a
8

\$ which python

/usr/bin/python

\$ ll `!!`

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

[Ctrl+_]
bind '"\C-l":"ls -l\n"'
2010-11-19 09:14:16
User: strzel_a
23

Now type Ctrl-l and it will list all files

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

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
5

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
1

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
4

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
2

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