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.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.
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

pipe output of a command to your clipboard

Terminal - pipe output of a command to your clipboard
some command|xsel --clipboard
2009-07-08 11:52:48
21
pipe output of a command to your clipboard

In turn you can get the contents of your clipboard by typing xsel by itself with no arguments:

xsel

This command requires you to install the xsel utility which is free

Alternatives

There are 6 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

A shorter alternative would be xclip:

some command | xclip

which does the exact same thing.

Comment by spatz 436 weeks and 3 days ago

On Darwin, you can do this:

some command | pbcopy
Comment by isaacs 436 weeks and 3 days ago

In OSX, pipe to pbcopy and paste from pbpaste

Comment by zabouti 436 weeks and 1 day ago

Guess I should have read isaacs comment before posting!!

Comment by zabouti 436 weeks and 1 day ago

xclip and xsel are available as packages of the same names at least under Debian/Ubuntu. They are not installed by default.

Comment by bwoodacre 436 weeks ago

"In turn you can get the contents of your clipboard by typing xsel by itself with no arguments" -- that's wrong. That'll give you the contents of the X selection, not the clipboard which was set by the command above it.

And spatz's comment is also incorrect -- his command will set the X selection, not the X clipboard as in the command he's replying to.

I'll explain:

xsel and xclip do pretty much the same things, but xsel is a little more advanced and has a nicer syntax.

It's important to realize that the X selection (there are two of these -- primary and secondary, but no-one really uses the secondary) is different from the X clipboard.

The (primary) X selection is what is set when some text is selected and is usually retrieved when the middle mouse button is clicked. The X selection is usually cleared when the program which set it exits.

The X clipboard is what most programs write to and read from when the cut/copy/paste commands are used. It isn't wiped when the program exits. So this is what to use if you want to do a control-v somewhere rather than a middle click.

Both xsel and xclip use the primary X selection by default. To set it

some command | xsel

or

some command | xclip

To retrieve it

xsel

(xsel detects what stdin and stdout are, and picks input or output automatically. See its manpage.)

or

xclip -o

To set the X clipboard

some command | xsel -b

or

some command | xclip -selection clipboard

And to retrieve it

xsel -b

or

xclip -selection clipboard -o

In vim you can read and write to both of these by using the "+ (X clipboard) and "* (X selection) registers. For example, to copy the current line to the X clipboard, type "+yy

To paste from X selection, type "*p

Comment by tremby 429 weeks ago

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

http://www.canadagoosejacketssale.us.com

http://www.cheapraybans-sunglasses.us.com

http://www.michaelkorsoutletofficials.us.com

http://www.christian-louboutinoutlet.us.org

http://www.christianlouboutin.com.co

http://www.ralphlaurenpoloshirts.me.uk

http://www.lacosteoutlet.us.org

http://www.adidasshoes.us.org

http://www.coachfactoryoutletonlinestores.us.com

http://www.ralph-laurenpolooutlet.us.com

http://www.mont-blancpens.us.com

http://www.michaelkorsoutletclearancee.us.com

http://www.fitflopsaleclearance.us.com

http://www.polooutlet.name

http://www.coachfactoryoutletofficials.us.com

http://www.raybansunglassesformen.us.com

http://www.mbtshoesoutlets.us.com

http://www.oakley-sunglassesoutletonline.us.com

http://www.nikeshoes.com.co

http://www.cheapuggboots.name

http://www.cheapuggboots.org

http://www.raybansun-glasses.com.co

http://www.fredperry.org.uk

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

http://www.valentinooutlet.in.net

http://www.polooutletralphlauren.us.com

http://www.oakleysunglasseswholesaler.us.com

http://www.montblancpensoutlet.com

http://www.ralphlauren-polo.me.uk

http://www.yeezyboost350-v2.us.com

http://www.mcmoutletonline.us

http://raybansunglasses.co-sunglasses.com

http://nikeshoes.nike-com.com

http://www.oakley-sunglassesclearance.us.com

http://www.truereligionjeanss.us.com

http://www.pandoraoutlets.us.com

http://www.montblancpens-outlet.us.com

http://www.lunetterayban.fr

http://www.airjordan4.us

http://www.canadagooseoutlet-store.com.co

http://www.adidasnmd-r1.us.com

http://www.truereligionjeans-sale.us.com

http://www.mlbjerseys.net

http://www.adidasyeezyshoes.name

http://www.poloralphlaurenfactorystore.us.com

http://www.cheapjordans.name

http://www.edhardyclothing.us.com

http://www.michaelkorsoutletclearancehandbags.us.com

http://www.polo-ralphlaurenuk.me.uk

http://www.fitflops-saleclearance.us

http://www.cheapmlb-jerseys.us

http://www.nikeshoesoutlet.us.com

http://polooutlet.amegov.com

http://www.katespadeshandbags.us

http://www.ralphlauren-outletuk.org.uk

http://www.canadagoose.name

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

http://www.ralphlaurenoutlets.org.uk

http://www.michaelkorsoutlet-online.in.net

http://www.fredperrypoloshirts.co.uk

http://www.kate-spadeoutlet.us.org

http://www.nike-shoes.us.com

http://www.truereligion-outletstore.us.com

http://www.polo-ralphlauren-pascher.fr

http://www.poloralphlauren-uk.me.uk

http://www.mbtshoescheap.us.com

http://www.pradaoutletstore.us

http://www.pradaoutlet-store.us.com

http://poloralphlauren.amegov.com

http://www.true-religionoutletstore.us.com

http://www.lebron-jamesshoes.us.com

http://www.cheapuggs.name

http://www.michaelkorsoutlet-clearance.org

http://www.oakleysunglasseswholesales.us.com

http://www.michaelkorsoutlet-clearances.us.com

http://adidasyeezyshoes.adidassale.net

http://www.pandorajewelry-outlet.us.com

http://www.katespadeoutlet-store.us.com

http://www.longchampoutlet.us.org

http://www.nikeoutlet.com.co

http://www.oakleysunglasseswholesalee.us.com

http://www.oakleysunglassescheaps.us.com

http://www.fredperryoutlet.us.com

http://www.longchampoutletofficial.us.com

http://www.coachfactory-outlet.eu.com

http://www.adidasoutlet.com.co

http://www.asicsrunningshoes.us.com

http://www.coach-outletonlineclearance.us.com

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

http://www.oakleysunglassesformen.us.com

http://www.nhljerseyss.us.com

http://cheapraybansunglasses.co-sunglasses.com

http://www.coachfactoryoutletmiami.us.com

http://www.coachoutletcoachoutletstore.us.com

http://www.adidasoutlet.us.org

http://www.cheapjordansfor-sale.us.com

http://www.michaelkorsoutletofficial.com

http://www.hermesbeltsoutlet.us.com

http://www.pandoraoutletstore.us.com

http://www.michaelkorsoutlet-clearance.us

http://www.ralphlauren-shirts.org.uk

http://www.ralphlaurenoutletonlinestore.us.com

http://www.ralphlaurenofficial.us.com

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

http://www.michaelkorsoutletonlinestore.us.org

http://www.oakleysunglassesfactory.us.com

http://www.polooutlet.us.org

http://www.raybanssun-glasses.com.co

http://www.coachoutletonlinecoachfactoryoutlets.us.com

http://www.michaelkorssoutletclearance.us.com

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

http://nikeshoes.up-nike.com

http://www.poloralph-laurenuk.co.uk

http://www.michael-korsoutletstore.in.net

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

http://www.canadagoosejacketss.com.co

http://www.christian-louboutinshoes.us

http://www.coach-outletonlinecoachfactoryoutlet.us.com

http://www.cheapnfljerseys.eu.com

http://www.mlbjerseys-wholesale.us.com

http://www.adidasyeezy-shoes.us.com

http://www.nike-shoes.us.org

http://www.valentino-outlet.us.com

http://www.ralph-laurenpolo.us.org

http://www.raybansunglassesonsale90off.us.com

http://www.fitflopssaleclearance.name

http://www.coachoutletcoachfactoryoutlets.us.com

http://www.airjordan.us.org

http://www.canadagoose-outlets.com.co

http://raybansunglassesoutlet.co-sunglasses.com

http://www.uggoutlet.name

http://www.oakleysunglassesss.us.com

http://www.canadagooses.com.co

http://www.ralphlaurenshirts.me.uk

http://www.michaelkorsoutlet-clearance.com

http://www.cheapjordans-forsale.us.com

http://www.oakleysunglasseswholesaleonline.us.com

http://www.coachoutletonlinecoachfactoryoutlet.com.co

http://www.kate-spadeoutletstore.us.com

http://www.nbajerseyss.us.com

http://yeezyboost.adidassale.net

http://www.nikeoutletstorelocations.com

http://www.montblancpenss.com.co

http://www.pandorajewelrycharms.us.com

http://www.mulberryhandbagsuk.co.uk

http://www.hermesbirkins.us.com

http://www.coachoutlet-clearance.us.org

chenlili20170503

Comment by chenyingying 28 weeks and 3 days ago

Here Innovation http://www.huaracherunpas-cher.fr/nike-huarache-2013_159.html is the superior http://www.huaracherunpas-cher.fr/chaussures-air-huarache_128.html in which maintains organizations along http://www.huaracherunpas-cher.fr/huarache-enfant_62.html with the specific industries over the http://www.huaracherunpas-cher.fr/free-huarache_103.html long term and in http://www.huaracherunpas-cher.fr/huarache-og-2017_143.html your place of work storage space http://www.huaracherunpas-cher.fr/huarache-nike-blanche_127.html methods sector http://www.huaracherunpas-cher.fr/nike-huarache-id_164.html your Japanese organization continues http://www.huaracherunpas-cher.fr/air-huarache-solde_40.html to be in the lead for a long http://www.huaracherunpas-cher.fr/huarache-light-og_105.html time at this http://www.huaracherunpas-cher.fr/nike-huarache-3_108.html moment. Tellus Devices Limited., based http://www.huaracherunpas-cher.fr/nouvelle-nike-huarache_82.html in Bangkok, features continuously perfected http://www.huaracherunpas-cher.fr/boutique-nike-huarache_151.html its product of http://www.huaracherunpas-cher.fr/huarache-5_74.html cell phone shelves utilised http://www.huaracherunpas-cher.fr/nike-huarache-1991_55.html by firms because of http://www.huaracherunpas-cher.fr/air-huarache-femme_90.html their small storage of information http://www.huaracherunpas-cher.fr/huarache-bordeaux_53.html , paperwork and also basic http://www.huaracherunpas-cher.fr/nike-huarache-run_72.html office supplies. Having an http://www.huaracherunpas-cher.fr/nike-huarache-fille_148.html unique notion, by quite a few Sixty years http://www.huaracherunpas-cher.fr/huarrache-blanche_135.html ago from the Compactus business http://www.huaracherunpas-cher.fr/chaussure-air-huarache_180.html of Exercise, Tellus http://www.huaracherunpas-cher.fr/nike-huarache-rouge_81.html has continually replaced the http://www.huaracherunpas-cher.fr/air-huarache-paris_138.html functions plus capacities http://www.huaracherunpas-cher.fr/huarache-4_118.html of their solutions over the http://www.huaracherunpas-cher.fr/huarache-chaussure_122.html last 10 years and has now http://www.huaracherunpas-cher.fr/chaussures-huarache_56.html introduced a whole http://www.huaracherunpas-cher.fr/huarache-nike-noir_149.html new name for their brand of http://www.huaracherunpas-cher.fr/nike-air-huarache-turquoise_160.html goods called http://www.huaracherunpas-cher.fr/nike-air-huarache-taille_172.html Mobilux.Mobilux company hard drive products and solutions http://www.huaracherunpas-cher.fr/nike-huarache-usa_114.html have several improvements however http://www.huaracherunpas-cher.fr/huarache-og_183.html the most crucial point with regards http://www.huaracherunpas-cher.fr/nike-huarache-boutique_147.html to all http://www.huaracherunpas-cher.fr/basket-huarache_63.html these ever-evolving products could be essential purpose http://www.huaracherunpas-cher.fr/air-huarache-homme_67.html C they will http://www.huaracherunpas-cher.fr/nike-huarache-toute-noir_154.html spend less fantastic numbers http://www.huaracherunpas-cher.fr/huarache-vintage_42.html of place, and so cash, for people http://www.huaracherunpas-cher.fr/nike-air-huarache-original_144.html that have used them. http://www.huaracherunpas-cher.fr/nike-id-huarache_158.html Lots of http://www.huaracherunpas-cher.fr/nike-huarache-prix_66.html people may not be knowledgeable about http://www.huaracherunpas-cher.fr/huarache-air-max_163.html cell phone shelves http://www.huaracherunpas-cher.fr/nike-air-huarache-blanche_153.html but if you present an workplace http://www.huaracherunpas-cher.fr/nike-huarache-homme_141.html that will produces http://www.huaracherunpas-cher.fr/nike-air-huarache-1991_65.html records that really must be http://www.huaracherunpas-cher.fr/nike-huarache-beige_91.html kept in addition to used http://www.huaracherunpas-cher.fr/huarache-bleu_111.html very easily in that case http://www.huaracherunpas-cher.fr/huarache-noir_86.html Mobilux products and solutions http://www.huaracherunpas-cher.fr/nike-air-force-huarache_124.html can offer some http://www.huaracherunpas-cher.fr/nike-huarache_93.html great alternatives for virtually any http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine_64.html enterprise.And, Mobiluxs storage area racks will not http://www.huaracherunpas-cher.fr/chaussure-nike-air-huarache_76.html be http://www.huaracherunpas-cher.fr/air-huarache-run_157.html restricted to merely workplaces. There http://www.huaracherunpas-cher.fr/nike-air-huarache-run-chaussures_174.html are various purposes that businesses while http://www.huaracherunpas-cher.fr/nike-air-huarache-homme_150.html diverse as educational http://www.huaracherunpas-cher.fr/nike-huarache-light-ultramarine_171.html institutions plus retail store http://www.huaracherunpas-cher.fr/air-nike-huarache_107.html shoe retailers have found for these http://www.huaracherunpas-cher.fr/nike-huarache-jd_46.html particular items and there are innovative http://www.huaracherunpas-cher.fr/huarache-light_50.html applications remaining developed all the http://www.huaracherunpas-cher.fr/nike-air-huarache-run_43.html time. http://www.huaracherunpas-cher.fr/nike-huarache-solde_94.html As Mobilux helps to keep incorporating characteristics to http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine-og_75.html their product line and therefore http://www.huaracherunpas-cher.fr/nike-air-huarache-blanc_41.html doing http://www.huaracherunpas-cher.fr/nike-air-huarache-light_168.html the storage devices shelves solutions http://www.huaracherunpas-cher.fr/nike-huarache-marron_165.html a lot more accommodating and http://www.huaracherunpas-cher.fr/huarache-chaussures_95.html versatile of their operation, innovative http://www.huaracherunpas-cher.fr/nike-air-force-1-huarache_113.html tips on with your flip http://www.huaracherunpas-cher.fr/nike-huarache-free-light_134.html storage area methods http://www.huaracherunpas-cher.fr/nike-air-huarache-rouge_47.html continue to keep offering themselves.There are wide http://www.huaracherunpas-cher.fr/huarache-beige_106.html ranging specialised reasons why Mobilux http://www.huaracherunpas-cher.fr/nike-air-huarache-90_110.html backpacks are greater than http://www.huaracherunpas-cher.fr/nike-huarache-magenta_51.html their competitors http://www.huaracherunpas-cher.fr/air-huarache-noire_117.html though the overriding edge that http://www.huaracherunpas-cher.fr/nike-huarache-paris_69.html cellular self storage units currently have above http://www.huaracherunpas-cher.fr/huarache-noir-femme_60.html ordinary filing http://www.huaracherunpas-cher.fr/nike-huarache-taille_49.html display cases and shelves is http://www.huaracherunpas-cher.fr/nike-huarache-pour-femme_155.html the fact companies that http://www.huaracherunpas-cher.fr/air-flight-huarache_68.html make use of techniques save http://www.huaracherunpas-cher.fr/nike-huarache-violet_54.html the your lease http://www.huaracherunpas-cher.fr/nike-air-huarache-mid_78.html they purchase space. This simple simple fact http://www.huaracherunpas-cher.fr/basket-nike-huarache_45.html by yourself signifies http://www.huaracherunpas-cher.fr/huarache-leopard_77.html that these kind http://www.huaracherunpas-cher.fr/nike-air-huarache-international_104.html of storage devices methods pay for http://www.huaracherunpas-cher.fr/acheter-huarache_84.html them selves over the long http://www.huaracherunpas-cher.fr/nike-air-max-huarache-hybrid_121.html term. This is http://www.huaracherunpas-cher.fr/nike-huarache-agassi_133.html their particular main benefits intended for http://www.huaracherunpas-cher.fr/nike-huarache-ultramarine_125.html companies that want to http://www.huaracherunpas-cher.fr/ its important thing nevertheless there http://www.huaracherunpas-cher.fr/nike-air-huarache-light-pas-cher_44.html are numerous other more http://www.huaracherunpas-cher.fr/air-huarache-og_71.html intangible, yet critical, advantages too.One in http://www.huaracherunpas-cher.fr/huarache-run_132.html the benefits http://www.huaracherunpas-cher.fr/nike-huarache-premium_126.html in which cell business office hard http://www.huaracherunpas-cher.fr/nike-huarache-gris_59.html drive programs offer is relieve which http://www.huaracherunpas-cher.fr/air-huarache-light_139.html staff members can access http://www.huaracherunpas-cher.fr/nike-air-flight-huarache_102.html files, papers, gifts http://www.huaracherunpas-cher.fr/nike-air-huarache-bleu_167.html and any other materials that are http://www.huaracherunpas-cher.fr/nike-air-huarache-og_162.html held in http://www.huaracherunpas-cher.fr/huarache-instagram_169.html cellular rack. A firm might much http://www.huaracherunpas-cher.fr/nike-huarache-2_166.html better manage the hard drive http://www.huaracherunpas-cher.fr/huarache-nike-chaussures_131.html programs and needed documents plus http://www.huaracherunpas-cher.fr/huarache-femmes_170.html supplies very easily accessible for http://www.huaracherunpas-cher.fr/air-huarache-grise_142.html employees. Any time http://www.huaracherunpas-cher.fr/huarache-nike-pas-cher_79.html saved for that reason may http://www.huaracherunpas-cher.fr/nike-air-huarache-retro_70.html enormously have http://www.huaracherunpas-cher.fr/nike-huarache-femmes_182.html an impact on employees production producing http://www.huaracherunpas-cher.fr/nike-huarache-leopard_57.html a more cost-effective and successful http://www.huaracherunpas-cher.fr/air-huarache-blanc_123.html enterprise.Also, at a strictly beauty http://www.huaracherunpas-cher.fr/nike-air-huarache-prix_120.html perspective Mobilux storage http://www.huaracherunpas-cher.fr/huarache-montante_179.html devices solutions generate a http://www.huaracherunpas-cher.fr/achat-nike-huarache_137.html fresh, uncluttered search for any business. http://www.huaracherunpas-cher.fr/nike-air-flight-huarache-og_48.html With the many pattern possibilities http://www.huaracherunpas-cher.fr/huarache-noir-et-rose_109.html the business features, almost any http://www.huaracherunpas-cher.fr/nike-huarache-run-pas-cher_61.html company or work environment http://www.huaracherunpas-cher.fr/nike-huarache-femme-pas-cher_140.html may become a http://www.huaracherunpas-cher.fr/air-max-huarache_39.html far more rousing and also attractive http://www.huaracherunpas-cher.fr/nike-huarache-blanc_85.html setting in order to do the http://www.huaracherunpas-cher.fr/huarache-free-run_145.html job. Its tough http://www.huaracherunpas-cher.fr/nike-air-huarache-pas-chere_161.html to evaluate most of http://www.huaracherunpas-cher.fr/huarache-2017_99.html these pros with figures however the http://www.huaracherunpas-cher.fr/nikeair-huarache_88.html effects http://www.huaracherunpas-cher.fr/nike-huarache-free-run-2012_146.html on staff member well-being and also attitude is http://www.huaracherunpas-cher.fr/nike-air-huarache-beige_112.html still an http://www.huaracherunpas-cher.fr/nike-air-huarache-run-pas-cher_98.html obvious advantage.And, spoken about http://www.huaracherunpas-cher.fr/chaussure-huarache-nike_173.html above, Mobilux is previous to http://www.huaracherunpas-cher.fr/nike-huarache-free-run-pas-cher_156.html its opposition inside advancement of these kinds http://www.huaracherunpas-cher.fr/nike-huarache-chaussures_129.html of bendable hard http://www.huaracherunpas-cher.fr/nike-huarache-safari_52.html drive systems and makes http://www.huaracherunpas-cher.fr/chaussures-huarache-nike_152.html good quality programs offered. Light materials, http://www.huaracherunpas-cher.fr/nike-huarache-light-og_115.html exceptional style and design http://www.huaracherunpas-cher.fr/nike-air-huarache-safari_73.html attributes and higher versatility http://www.huaracherunpas-cher.fr/air-huarache-nike_87.html inside making your solutions http://www.huaracherunpas-cher.fr/nike-air-huarache-solde_181.html a few of why Mobilux is constantly http://www.huaracherunpas-cher.fr/nike-air-zoom-huarache_89.html differentiate themselves from other http://www.huaracherunpas-cher.fr/nike-air-huarache-2_92.html individuals in http://www.huaracherunpas-cher.fr/huarache-usa_100.html the industry. Mobilux has produced it's enterprise http://www.huaracherunpas-cher.fr/huarache-acheter_83.html together http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-rose_58.html with goods that are the best http://www.huaracherunpas-cher.fr/nike-air-huarache-og-retro_101.html around superior and creativity http://www.huaracherunpas-cher.fr/huarache-noir-et-blanc_96.html plus a assistance doctrine http://www.huaracherunpas-cher.fr/nike-air-huarache-noir_97.html that gives man or women attention http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-bleu_130.html and also problem-solving almost every purchaser, http://www.huaracherunpas-cher.fr/air-huarache-noir_116.html small or http://www.huaracherunpas-cher.fr/nike-air-huarache-chaussures_80.html big.If your organization haven't researched applying portable storage systems then currently may be the time and energy to do this. For all of the reasons stated above and more, the employment of Mobilux storage area methods will help your online business to grow and grow in a orderly, structured along with rewarding approach. For more information observe.

Comment by scott154 10 weeks and 4 days ago

Your point of view

You must be signed in to comment.