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

Execute a command without saving it in the history

Terminal - Execute a command without saving it in the history
<space>command
2009-03-17 16:25:29
User: eaZy
414
Execute a command without saving it in the history

Prepending one or more spaces to your command won't be saved in history.

Useful for pr0n or passwords on the commandline.

Tested on BASH.

Alternatives

There are 7 alternatives - vote for the best!

Terminal - Alternatives
cat | bash
2010-08-18 13:47:46
User: glaudiston
Functions: cat
7

Sometimes you don't want to leave history, because of passwords use or somethink like.

I think it help.

read -e -s -p "Password: " password
2010-08-18 17:53:27
User: freiheit
Functions: read
4
wget --user=username --password="$password" http://example.org/

Instead of hiding commands entirely from history, I prefer to use "read" to put the password into a variable, and then use that variable in the commands instead of the password. Without the "-e" and "-s" it should work in any bourne-type shell, but the -s is what makes sure the password doesn't get echoed to the screen at all. (-e makes editing work a bit better)

export HISTCONTROL=ignorespace
2013-07-25 08:31:10
User: gorynka
Functions: export
3
<space>secret_command;export HISTCONTROL=

This will make "secret_command" not appear in "history" list.

<space> secret -p password
2011-09-16 12:41:16
User: pcholt
1

Put a space in front of your command on the command line and it will not be logged as part of your command line history.

HISTFILE= ; your_secret_command
2012-01-26 21:08:57
User: titan2x
1

Yes, by correctly setting the HIST* variables you can make certain commands not saved in history. But that's complicated and easy to make a mistake. If you set HISTFILE= to blank, nothing in your current shell session will be saved in history. Although this is not a precise answer to the subject, but it's very simple.

Know a better way?

If you can do better, submit your command here.

What others think

depends on the variable HISTCONTROL

(must be ignoreboth to work)

Comment by albanichou 408 weeks and 6 days ago

You use the command line for pr0n?! lolz

Comment by zombiedeity 408 weeks and 6 days ago

hmmm... 45(1 pr0n?

Comment by IMissDos 408 weeks and 6 days ago

From man bash:

HISTCONTROL

A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ignorespace, lines which begin with a space character are not saved in the history list. A value of ignoredups causes lines matching the previous history entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups.

A value of erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. If HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.

Comment by Malkavian 408 weeks and 6 days ago

I wouldn't rely on this 'feature' ;) -- see other comments about HISTCONTROL in addition to reading the manual for bash!

Comment by alexandersafir 408 weeks and 6 days ago

In zsh you can do "fc -p" to switch to a new history (and make $HISTFILE empty) and "fc -P" to switch back to the last one.

Comment by cran 408 weeks and 6 days ago

you have to put:

export HISTIGNORE="[ \t]*"

in ~/.bashrc for this to work. if you don't have .bashrc in in ~/ just make your own

Comment by genofunk 408 weeks and 5 days ago

this looks like a bug in bash...if you don't alter HISTCONTROL of course.

Comment by wwoollff 406 weeks and 6 days ago

Use kill to exit the shell instead of exit or logout:

kill -9 $$
Comment by vutcovici 406 weeks and 3 days ago

ironically export HISTIGNORE="[ \t]*" or

echo export HISTIGNORE="[ \t]*" >> .bashrc

will appear in the history :)

You should do

<space> history -d N

Where N is the postion export HISTIGNORE="[ \t]*"

Comment by funyotros 375 weeks and 6 days ago

an easier way to do this in zsh is to add "setopt HIST_IGNORE_SPACE" to your .zshrc

it'll then behave like this command should, but keep the space'd command in history till you enter another one

(from man zshoptions)

Comment by awh 243 weeks and 5 days ago

export HISTCONTROL=ignorespace worked for me. Testet on Centos 5

Comment by wahallah 215 weeks and 1 day ago

IBM AIX's ksh supports it too, but as with CentOS, you have to export HISTCONTROL=ignorespace.

Comment by RAKK 173 weeks and 4 days ago

2016-1-26 xiaozhengm

http://www.coachfactory--outletonline.com

http://www.fitflopuk.me.uk

http://www.michaelkorsukbag.co.uk

http://www.get-coachoutletonline.org

http://www.michaelkors-handbag.me.uk

http://www.runningshoes.com.co

http://www.toms-outlet.cc

http://www.ugg-boots-store.com

http://www.louboutinshoes.cc

http://canadagoose.outletmalls.us.com

http://www.nike-blazerlow.fr

http://uggs.uggaustralia.qc.com

http://www.nikestoreuk.me.uk

http://www.true-religionjeans.net.co

http://coach.outletmalls.us.com

http://www.adidasshoes.name

http://michaelkors.adsmall.us.com

http://www.hermesbelt.in.net

http://www.mulberry-bags.org.uk

http://coach.eshopping.us.com

http://louisvuitton.outletmalls.us.com

http://www.hermesuk.org.uk

http://www.katespadeoutletsale.in.net

http://toms.adsmall.us.com

http://www.fitflopssaleclearance.com

http://michaelkors.eshopping.us.com

http://ugg.adsmall.us.com

http://www.louis-vuitton-outlet.us.com

http://www.canadagoosejackets.org.uk

http://ugg.eshopping.us.com

http://www.timberlanduk.me.uk

http://www.jordan13.org

http://christianlouboutin.outletmalls.us.com

http://www.coachoutlet-storeonline.in.net

http://www.instylermax.in.net

http://www.coachfactoryoutletus.in.net

http://www.coachoutlet-storeonline.us.com

http://tiffany.outletmalls.us.com

http://www.louboutin.org.uk

http://www.monclerjacketsoutlet.us.com

http://louboutin.adsmall.us.com

http://www.louisvuitton-borse.it

http://www.mcmhandbags.name

http://www.truereligion-outlet.com

http://www.new-balanceoutlet.us

http://www.louisvuitton-sac-pascher.fr

http://www.outlet-toms.cc

http://canadagoose.shopgioia.com

http://www.coach-factory-outlet-online.us.com

http://www.top-coachoutletstore.org

http://www.edhardy-outlet.name

http://www.jordan6.net

http://www.longchamphandbags.com.co

http://www.chaussurelouboutin-pascher.fr

http://www.ghdstraighteners.me.uk

http://www.nike-tn-pascher.fr

http://www.saclongchamp-solde.fr

http://www.coachcanadaoutlet.ca

http://burberryoutlet.outletmalls.us.com

http://sunglasses.outletmalls.us.com

http://www.michael--korsoutlet.us.com

http://www.nikefreeruns.uk

http://michaelkors.outletmalls.us.com

http://www.mk-michaelkorsoutletonline.com

http://www.cheaplouisvuittonhandbags.org

http://burberry.eshopping.us.com

http://www.michaelkors-outletonlines.in.net

http://www.airjordan-pascher.fr

http://www.ralphlaurenuk.me.uk

http://www.moncler-jackets.org

http://www.adidassuperstar.co.uk

http://abercrombie.shopgioia.com

http://www.authenticlouisvuittonhandbags.net

http://www.airforce1-nike.fr

http://www.coach-factoryoutlet.cc

http://www.coachoutletonlinespick.org

http://www.coachouletbtf.com

http://rayban.eshopping.us.com

http://www.ghdhairstraighteners.com.co

http://www.ralph-lauren-pas-cher.fr

http://ralphlauren.shopgioia.com

http://rayban.adsmall.us.com

http://www.mcmoutlet.us

http://www.louisvuittonuk.me.uk

http://www.jordan-femmepascher.fr

http://www.toms.in.net

http://burberry.outletmalls.us.com

http://www.cheap-uggsonsale.in.net

http://oakley.adsmall.us.com

http://www.basketballshoes.net.co

http://ugg.shopgioia.com

http://www.raybansoutlet.in.net

http://www.mizunorunningshoes.in.net

http://www.pandoracharms.com.co

http://www.truereligion-outlet.in.net

http://www.michaelkorsoutletoff.in.net

http://www.tomswedges.in.net

http://ugg.outletmalls.us.com

http://www.cheapjordansshoes.in.net

http://www.mymichaelkorssoutlets.org

http://www.airjordan-uk.org.uk

http://www.michaelkors-handbags.me.uk

http://www.nikeblazers.me.uk

http://burberry.shopgioia.com

http://timberland.adsmall.us.com

http://coach.adsmall.us.com

http://www.nike-airmax90.me.uk

http://www.nikesb.uk

http://www.nikerosherunwomen.me.uk

http://www.christianlouboutinuk.me.uk

http://www.ugg-boots-australia.com

http://www.adidas-trainers.me.uk

http://www.michaelkors-discount.com

http://www.polooutlet.us.com

http://www.niketrainers.com.co

http://www.airmax95.org.uk

http://www.montblancpens.us.org

http://www.adidasuk.org.uk

http://www.poloralphlauren.net.co

http://www.rolex-replicawatches.com.co

http://www.ralph-lauren.me.uk

http://www.jordan3.net

http://www.cheapwholesaleuggboots.com

http://hollister.shopgioia.com

http://www.michaelkorshandbags.cc

http://www.fitflops.in.net

http://www.snapbacks-wholesale.us

http://www.edhardyukclothing.me.uk

http://www.michaelkors-outlet-handbags.com

http://www.fitflops.us

http://www.raybans.org.uk

http://northface.outletmalls.us.com

http://nike.outletmalls.us.com

http://www.michaelkorsoutletforus.com

http://www.toryburchoutlet-sale.in.net

http://www.juicy-couture.us

http://www.raybansunglassesdeals.com.co

http://www.louis-vuittonhandbags.us

http://www.quality-outlet.com

http://christianlouboutin.eshopping.us.com

http://www.cheap-tomsoutlet.us

http://www.longchampoutlet.net.co

http://www.michaelkors-bags.me.uk

http://www.louisvuittonoutlets.name

http://www.coach-factoryoutlet.eu.com

http://www.tomsshoes.us.com

http://www.canadagooseoutlet.cc

http://canadagoose.adsmall.us.com

http://www.adidasgazelle.me.uk

http://christianlouboutin.shopgioia.com

http://www.kate-spadeoutlet.com.co

http://www.pradaoutlet.name

http://www.guccioutlet.com.so

http://www.jordan4.net

http://canadagoose.eshopping.us.com

http://www.michael-korshandbags.net.co

http://www.soccer-jerseys.us.com

http://www.nikerosheruns.me.uk

http://www.truereligion-outlet.net.co

http://oakley.shopgioia.com

http://www.sunglass-outlet.us

http://www.chiflatiron.in.net

http://www.tomsoutletstore.in.net

http://www.coachoutletstoreonlines.us

http://www.gucci-borse.it

http://www.jordan8.net

http://www.michaelkors-mkoutlet.in.net

http://www.chaussure-louboutin.fr

http://www.michaelkors-outletsale.com

http://www.michael-korsuk.me.uk

http://www.nike-airmax.org.uk

http://burberry.adsmall.us.com

http://www.montblanc-pens.name

http://www.sac-longchamppliage.fr

http://www.saclongchamp--pascher.fr

http://www.michaelkorsoutletvip.in.net

http://www.cheapjordans.com.co

http://www.louisvuitton-outletstores.org

http://www.marc-jacobs.in.net

http://www.pandorajewelryoutlet.name

http://www.christianlouboutinsell.net

http://www.michael-kors-handbags.uk

http://rayban.shopgioia.com

http://www.oakleysunglassesfake.in.net

http://www.kate-spadeoutlet.us

http://www.coach-factoryoutlet.com.co

http://www.gucci-outlet.org

http://www.adidas-shoes.me.uk

http://ralphlauren.eshopping.us.com

http://oakley.eshopping.us.com

http://www.vipmichaelkors-outletonline.com

http://www.canadagooseuk.me.uk

http://www.oakley--sunglasses.us.org

http://www.kate-spadeoutlet.in.net

http://truereligion.adsmall.us.com

http://jordan.outletmalls.us.com

http://www.guccioutlet.net.co

http://www.nikeuk.me.uk

http://www.katespadeuk.me.uk

http://www.christianlouboutinoff.us

http://www.nikecortez.com.co

http://www.nikehuarache.com.co

Comment by xiaozhengm 51 weeks ago

If you will unquestionably uncover the kinds of styles and styles you'll undoubtedly track down this really difficult to pick the best watch. The idea performs exceptionally well to take into account the apparel you generally like better to put on. This may surely allow you to pick the style in a significantly better means. If you wish to produce an completely superior seem, apply for the particular cherish studded knobs or whatsoever satisfies the styling along with character. Really should be truth number of observe is a entirely individual alternative. Really the only position you need to stay in thought processes could be that the watch a person don must help you enhance your design and individuality along with fit into your spending plan.MK can be a deluxe brand name which includes in reality made it's fantastic background. Respects like the CFDA Girl's Designer of this year throughout Late 90s, this CFDA Guys's Fashion Designer of year throughout 2003 along with the CFDA Life-time Results Respect last year possess really exposed the world why this MK's variety is really a tension being believed with. singularly needs a operations career inside the form of almost all merchandise. More than likely that is why the company identify has stayed to increase along with awareness this http://www.hermesbeltsbirkinkellybag.co.uk/ kind of big people. His / her enjoy assortment features protected some sort of experience of high quality and sophistication that will certainly desired destination fans for extended periods before hand.Michael Kors Web site provides the suggestions of assorted involving his / her loyal fashion gimmick fans. Mainly because getting good honours and the headline regarding amongst the 'Leading ONE HUNDRED The majority of Important Men and women involving 2013' simply by Time period Work schedule, his attraction provides in truth improved also on top of that.December 15, 2011, Wall plug Outlet market place, started off the rate involving globally development. Shutting down since 03 8, 2013, this at Dollar 61.Twenty, offers gone up 206 percentage, as compared to the Twenty bucks trouble charge offers in fact was with latest many years amongst the most effective IPO. Currently, the market in about $ 14.Half-dozen billion dollars, possibly much more than Nine dollars.1 zillion Burberry approximation Instructor Dollar 18 million.Now, exclusively everything you require is actually find this kind of fashionable globe, along with select the manner trend bags. Science in addition to modern-day invention also participate in an important are employed in each of our socialist design. As is also thus vital, you'll need this particular Hand bags to get your own fashionable style. And you'll undoubtedly neurological to help repent to obtain it, as a result of reality that is neural to the style pattern age group. Tend not to invest some time type of more time.The technological know-how on the Physical exercise watch-making custom-made is an confidence of excellent in addition to accuracy. The most notable quality of each Versace view is actually guaranteed from the Physical exercise Made' remembering. Each and every clock is going via strict controls and all sorts of goods in order to complete examinations. Versace landscapes package exclusive designs for people who for example to be aside.Now, that which you call for will be catch this specific modern-day spot, and select the design and style novelty bags. Scientific research in addition to fashionable technological innovation moreover play an essential functionality inside our socialist building. Along with and so vital, you would like this specific Hand bags to demonstrate the present day design pattern. And you will certainly lack of feeling to become remorseful regarding to receive the item, due to the reality that is lack of feeling back in the design period. Tend not to offered all-around any sort of more time.MK going in the item of clothing, 04, MK grab the gold amount of improvement in the units, accessories become the fastest broadening high-end baseding upon Altagamma Scientific tests facts uncover, coming from 2005 for you to The year 2010, the material each year rate of growth associated with Nine percent this season the worldwide units cash flow regarding Money Fifty-seven.5 various million, a Twenty-five percent write about on the elegant items company. The equipment moreover during the entire economic economic downturn regarding 2007-2009, only sales growth inside luxurious class, this years product sales growth and development of 17 percent.

Comment by stephanieg915 19 hours ago

Your point of view

You must be signed in to comment.