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

Salvage a borked terminal

Terminal - Salvage a borked terminal
reset
2009-01-28 22:22:01
User: root
Functions: reset
293
Salvage a borked terminal

If you bork your terminal by sending binary data to STDOUT or similar, you can get your terminal back using this command rather than killing and restarting the session. Note that you often won't be able to see the characters as you type them.

Alternatives

There is 1 alternative - vote for the best!

Terminal - Alternatives
stty sane
2009-11-09 15:58:06
User: darkpand
Functions: stty
Tags: terminal reset
14

When some console full-screen program (minicom, vi, some installers) breaks down your terminal, try this command to revert all options to "sane" settings (sane is a built-in combo of a lot of stty options)

<ctrl+j>stty sane<ctrl+j>
2009-08-05 21:50:07
User: CharlieInCO
12

This is more or less the same as 'reset', but with two advantages: the initial LF character makes sure you're starting a new line to the tty driver, the final one is more reliably a line-end as CR is often unset; and second, 'stty sane' is reliable on older UNIX systems, especially Berkeley-based ones.

echo <ctrl-v><esc>c<enter>
2009-08-05 18:32:28
User: kcm
Functions: echo
10

This works in some situations where 'reset' and the other alternatives don't.

reset
reset
2009-11-09 16:15:26
User: flart
Functions: reset
1

If something fracks up your terminal, just type in 'reset' and everything should be good again.

Know a better way?

If you can do better, submit your command here.

What others think

Nice to know. I normally always reset it by typing "cat /bin/ls" (you can use any binary file you want) and hitting ^C while it's still cat'ting.

Comment by LudoA 408 weeks and 1 day ago

Use "cat -v" instead of "cat" to cat binary files without borking the terminal.

Comment by int19h 406 weeks and 5 days ago

interesting enough, +enter will fix this as well, no need for external commands.

Comment by SiegeX 406 weeks and 4 days ago

stupid tag parsing. Lets try this again:

interesting enough ctrl+v,ctrl+o then hitting enter will fix this as well, no need for external commands.

Comment by SiegeX 406 weeks and 4 days ago

reset doesn't always work for me if the terminal is borked, is this a bug or am I doing something wrong? Anyone else encountered reset not resetting the terminal?

Comment by int19h 406 weeks and 4 days ago

in alternative, this is what I use:

http://www.commandlinefu.com/commands/view/866/reset-an-hanging-terminal-session

Comment by berta 406 weeks and 3 days ago

@int19h: Yeah, reset doesn't always work.

Comment by mulad 406 weeks and 2 days ago

This is what the 'file' command is for. If you don't know the file type you're about to echo to the terminal, run 'file' on it before hand, then use the right tool to parse its data. If you do, and reset doesn't work, ^Jreset^j might. ^j (ctrl-j) is the ASCII key sequence for the Enter key.

Comment by atoponce 404 weeks and 5 days ago

Interesting, I always use "stty sane" CTRL-J

Comment by mpb 402 weeks and 4 days ago

'reset' goes with tset and the System V-style termio. stty sane does much the same thing but is portable to the older style terminal driver.

Comment by CharlieInCO 382 weeks and 2 days ago

I simply have the solution SiegeX presented as part of my system prompt so I never get borked.

Using Vi in binary mode I edited my .bashrc and inserted the control character into the PS1 variable so that PS1="\u@\h^O" (^O produced with ctrl+v,ctrl+o)

No more borked terminals.

Comment by john6of6 373 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 44 weeks and 4 days ago

Greetings! I know this is somewhat off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having problems finding one? Thanks a lot!

http://darksouls3fans.com

http://emojifb.com

http://slitherio2.com

http://happywheels2.co/

Comment by molamola 19 weeks and 4 days ago

I?m very happy to read this. This is the kind of manual that needs to be given and not the accidental misinformation that is at the other blogs. Appreciate your sharing this greatest doc.

http://geometrydash.co/

http://happywheelsaz.com

http://happywheels10.com

http://agario0.com

http://fivenightsatfreddysaz.com

Comment by geometrydash 19 weeks and 4 days ago

It's great, I have learned many useful things, to apply to my blog. You just like me!

https://plus.google.com/u/0/107023740377478224643/posts

https://twitter.com/baixarmusicas8

https://baixarmusicas8.wordpress.com/

https://sites.google.com/site/baixarmusicasgratis8/

http://baixarmusicas8.blogspot.com/

https://www.pinterest.com/baixarmusicas8/

https://www.flickr.com/photos/baixarmusicas8

http://imgfave.com/baixarmusicas8

http://baixarmusicas.deviantart.com/

http://baixarmusicas09.weebly.com/

https://myspace.com/baixar.musicas

http://baixarmusicas08.mywapblog.com/

https://www.diigo.com/user/baixarmusicas08

https://storify.com/baixarmusicas

http://hangngothi123.wixsite.com/baixarmusicas

http://baixarmusicas.over-blog.com/

http://www.scoop.it/u/baixar-musicas-1

http://baixarmusicas08.blog.fc2.com/

https://www.reddit.com/user/baixarmusicas/

http://baixarmusicas08.blogolink.com/

https://imgur.com/user/baixarmusicas08

http://www.slideshare.net/baixarmusicas08

http://baixarmusicas08.pixnet.net/blog

http://baixarmusicas08.kinja.com/

http://www.purevolume.com/baixarmusicas

http://weheartit.com/baixarmusicas

http://baixarmusicas08.yolasite.com/

http://www.baixarmusicas08.estranky.cz/

Comment by hoami 15 weeks and 3 days ago

It's great, I have learned many useful things, to apply to my blog. You just like me!

https://plus.google.com/u/0/114255537570764200580/posts

https://twitter.com/baixarsnapchat

https://baixarsnapchat.wordpress.com/

https://sites.google.com/site/baixarsnapchat8/

http://baixarsnapchat08.blogspot.com/

https://www.pinterest.com/baixarsnapchat/

https://www.flickr.com/photos/baixarsnapchat/

http://imgfave.com/baixarsnapchat08

http://baixarsnapchat.deviantart.com/

http://baixarsnapchat.weebly.com/

https://myspace.com/baixarsnapchat

http://baixarsnapchat.mywapblog.com/

https://www.diigo.com/user/baixarsnapchat

https://storify.com/baixarsnapchat

http://hangngothi124.wixsite.com/baixarsnapchat

http://baixarsnapchat.over-blog.com/

http://www.scoop.it/u/baixar-snapchat

http://baixarsnapchat.blog.fc2.com/

https://www.reddit.com/user/baixarsnapchat/

http://baixarsnapchat.blogolink.com/

http://imgur.com/user/baixarsnapchat

http://www.slideshare.net/baixarsnapchat

http://baixarsnapchat.pixnet.net/blog

https://kinja.com/baixarsnapchat

http://www.purevolume.com/baixarsnapchat

http://weheartit.com/baixarsnapchat

http://snapchat08.yolasite.com/

http://www.baixarsnapchat.estranky.cz

Comment by hoami 15 weeks and 3 days ago

Thank you. Posts truly bring useful information and great. You can also visit my website

https://plus.google.com/u/0/103527929900998384302/posts

https://twitter.com/strikeforceher0

https://strikeforceheroes2play.wordpress.com/

https://sites.google.com/site/strikeforceheroes2ct/

http://strikeforceheroes2ctp.blogspot.com/

https://www.pinterest.com/strikeforceher0/

https://www.flickr.com/photos/strikeforceheroes2play/

http://imgfave.com/strikeforceheroes2

http://strikeforceheroes2.deviantart.com/

http://strikeforceheroes2play.weebly.com/

Comment by haha 15 weeks and 3 days ago

You need to have time to take care of the active. It in fact was a amusement account it. Look advanced to far added agreeable from you.

Thanks you for sharing!

http://luckypatcher.pixnet.net/blog

https://kinja.com/luckypatcher

http://www.purevolume.com/listeners/luckypatcher

http://weheartit.com/luckypatcher

http://luckypatcher01.yolasite.com/

http://www.luckypatcher.estranky.cz/

http://luckypatcher.npage.de/

https://disqus.com/by/luckypatcher01/

http://www.popsugar.com/profile/luckypatcher

https://dribbble.com/luckypatcher

https://about.me/luckypatcher

Comment by ngocanh 14 weeks and 1 day ago

You need to have time to take care of the active. It in fact was a amusement account it. Look advanced to far added agreeable from you.

Thanks you for sharing!

http://templerun2.pixnet.net/blog

https://kinja.com/templerun2games

http://www.purevolume.com/listeners/TempleRun2

http://weheartit.com/templerun2games

http://templerun2games.yolasite.com/

http://www.templerun2.estranky.cz/

http://templerun2games.npage.de/

https://disqus.com/by/templerun2games/

http://www.popsugar.com/profile/templerun2

https://dribbble.com/templerun2games

https://about.me/templerun2

Comment by ngocanh 14 weeks and 1 day ago

http://imgur.com/user/clashroyale09

http://www.slideshare.net/clashroyale09

http://clashroyale.pixnet.net/blog

https://kinja.com/clashroyale09

http://www.purevolume.com/listeners/clashroyale09

http://weheartit.com/clashroyale09

http://www.clashrpyale.estranky.cz/

http://clashroyale09.npage.de/

https://disqus.com/by/clashroyale09/

https://dribbble.com/clashroyale09

https://dribbble.com/clashroyale09

https://about.me/clashroyale09

Comment by hoahong 14 weeks and 1 day ago

https://golauncher.imgur.com/

http://www.slideshare.net/golauncher09

http://golauncher.pixnet.net/blog

https://kinja.com/golauncher

http://www.purevolume.com/listeners/golauncher

http://weheartit.com/golauncher

http://golauncher.yolasite.com/

http://www.golauncher09.estranky.cz/

http://golauncher.npage.de/

https://disqus.com/by/golauncher/

http://www.popsugar.com/profile/go-launcher

https://dribbble.com/Golauncher

https://about.me/golauncher

Comment by hoahong 14 weeks and 1 day ago

You need to have time to take care of the active. It in fact was a amusement account it. Look advanced to far added agreeable from you.

http://go-launcher.net/

http://clashroyalegame.org/

http://subwaysurf.com.br/

http://drdriving.com.br/

http://tanktroublepage.com/

http://dream-league-soccer.com/

http://banana-kong.com/

Comment by cattrangg 7 weeks and 3 days ago

Your point of view

You must be signed in to comment.