CINXE.COM
Compound commands - OLPC
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"/> <title>Compound commands - OLPC</title> <script>document.documentElement.className="client-js";RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"6a9edf3b71d77bba20d23687","wgCSPNonce":false,"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Compound_commands","wgTitle":"Compound commands","wgCurRevisionId":267121,"wgRevisionId":267121,"wgArticleId":46259,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Compound_commands","wgRelevantArticleId":46259,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgVector2022PreviewPages":[]};RLSTATE={"site.styles":"ready", "user.styles":"ready","user":"ready","user.options":"loading","skins.vector.styles.legacy":"ready"};RLPAGEMODULES=["site","mediawiki.page.ready","skins.vector.legacy.js"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.implement("user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});});});</script> <link rel="stylesheet" href="/mediawiki/load.php?lang=en&modules=skins.vector.styles.legacy&only=styles&skin=vector"/> <script async="" src="/mediawiki/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""/> <link rel="stylesheet" href="/mediawiki/load.php?lang=en&modules=site.styles&only=styles&skin=vector"/> <meta name="generator" content="MediaWiki 1.39.7"/> <meta name="format-detection" content="telephone=no"/> <meta name="viewport" content="width=1000"/> <link rel="icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/mediawiki/opensearch_desc.php" title="OLPC (en)"/> <link rel="EditURI" type="application/rsd+xml" href="http://wiki.laptop.org/mediawiki/api.php?action=rsd"/> <link rel="alternate" type="application/atom+xml" title="OLPC Atom feed" href="/mediawiki/index.php?title=Special:RecentChanges&feed=atom"/> </head> <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Compound_commands rootpage-Compound_commands skin-vector action-view skin-vector-legacy vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-language-alert-in-sidebar-disabled vector-feature-sticky-header-disabled vector-feature-sticky-header-edit-disabled vector-feature-table-of-contents-disabled vector-feature-visual-enhancement-next-disabled"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Compound commands</span></h1> <div id="bodyContent" class="vector-body"> <div id="siteSub" class="noprint">From OLPC</div> <div id="contentSub"></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Jump to navigation</a> <a class="mw-jump-link" href="#searchInput">Jump to search</a> <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-parser-output"><p>A compound command is a list of commands that are tied together so that they work as one. </p><p>For example: </p> <pre>date && \ echo success </pre> <p>The <i>date</i> command is run, then if it works the <i>echo</i> command is run. If the <i>date</i> command were to fail, the <i>echo</i> command would not be run. For deep technical detail, see the BASH manual. </p> <h2><span class="mw-headline" id="Copy_and_Paste">Copy and Paste</span></h2> <div class="thumb tright"><div class="thumbinner" style="width:270px;"><a href="/go/File:Compound-command-example.png" class="image"><img alt="" src="/mediawiki/images/1/1d/Compound-command-example.png" decoding="async" width="268" height="494" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/go/File:Compound-command-example.png" class="internal" title="Enlarge"></a></div>Where to press, move, and release</div></div></div> <p>How to copy and paste a compound command. </p><p>Move the cursor above the first line, press and hold the mouse button, move the cursor below below the last line, then release the mouse button. </p><p>Look at the image. The green dot is where the mouse button should be pressed, and the red dot is where it should be released. Notice how the text has been highlighted. This shows the area that will be copied. </p><p>Next, use Copy in the web browser, and Paste in the Terminal. (The web browser keyboard shortcut for Copy is Ctrl/C, and the Terminal keyboard shortcut is Ctrl/Shift/V. Usually.) </p><p>The command will be run as soon as it is pasted. </p> <!-- NewPP limit report Cached time: 20241130174839 Cache expiry: 86400 Reduced expiry: false Complications: [] CPU time usage: 0.005 seconds Real time usage: 0.007 seconds Preprocessor visited node count: 3/1000000 Post鈥恊xpand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Highest expansion depth: 2/100 Expensive parser function count: 0/100 Unstrip recursion depth: 0/20 Unstrip post鈥恊xpand size: 0/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 0.000 1 -total --> <!-- Saved in parser cache with key wikidb:pcache:idhash:46259-0!canonical and timestamp 20241130174839 and revision id 267121. --> </div> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="http://wiki.laptop.org/mediawiki/index.php?title=Compound_commands&oldid=267121">http://wiki.laptop.org/mediawiki/index.php?title=Compound_commands&oldid=267121</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> <div id="mw-head"> <nav id="p-personal" class="vector-menu mw-portlet mw-portlet-personal vector-user-menu-legacy" aria-labelledby="p-personal-label" role="navigation" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Personal tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="pt-login" class="mw-list-item"><a href="/mediawiki/index.php?title=Special:UserLogin&returnto=Compound+commands" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span>Log in</span></a></li></ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="vector-menu mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy" aria-labelledby="p-namespaces-label" role="navigation" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Namespaces</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-nstab-main" class="selected mw-list-item"><a href="/go/Compound_commands" title="View the content page [c]" accesskey="c"><span>Page</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/mediawiki/index.php?title=Talk:Compound_commands&action=edit&redlink=1" rel="discussion" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li></ul> </div> </nav> <nav id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown" aria-labelledby="p-variants-label" role="navigation" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" /> <label id="p-variants-label" aria-label="Change language variant" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="vector-menu mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy" aria-labelledby="p-views-label" role="navigation" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Views</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-view" class="selected mw-list-item"><a href="/go/Compound_commands"><span>Read</span></a></li><li id="ca-viewsource" class="mw-list-item"><a href="/mediawiki/index.php?title=Compound_commands&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/mediawiki/index.php?title=Compound_commands&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li></ul> </div> </nav> <nav id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown" aria-labelledby="p-cactions-label" role="navigation" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" /> <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <div> <h3 > <label for="searchInput">Search</label> </h3> <form action="/mediawiki/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search OLPC" aria-label="Search OLPC" autocapitalize="sentences" title="Search OLPC [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> </div> </div> <div id="mw-panel"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="/go/The_OLPC_Wiki" title="Visit the main page"></a> </div> <nav id="p-About_OLPC" class="vector-menu mw-portlet mw-portlet-About_OLPC vector-menu-portal portal" aria-labelledby="p-About_OLPC-label" role="navigation" > <h3 id="p-About_OLPC-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">About OLPC</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-The-OLPC-Wiki" class="mw-list-item"><a href="/go/The_OLPC_Wiki"><span>The OLPC Wiki</span></a></li><li id="n-Contact-us" class="mw-list-item"><a href="/go/OLPC:Contact_us"><span>Contact us</span></a></li><li id="n-Blog" class="mw-list-item"><a href="http://blog.laptop.org" rel="nofollow"><span>Blog</span></a></li><li id="n-Communicate" class="mw-list-item"><a href="/go/Communication_channels"><span>Communicate</span></a></li><li id="n-Participate" class="mw-list-item"><a href="/go/Participate"><span>Participate</span></a></li><li id="n-laptop.org" class="mw-list-item"><a href="http://laptop.org" rel="nofollow"><span>laptop.org</span></a></li></ul> </div> </nav> <nav id="p-About_the_laptop" class="vector-menu mw-portlet mw-portlet-About_the_laptop vector-menu-portal portal" aria-labelledby="p-About_the_laptop-label" role="navigation" > <h3 id="p-About_the_laptop-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">About the laptop</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Specifications" class="mw-list-item"><a href="/go/Hardware"><span>Specifications</span></a></li><li id="n-Buying" class="mw-list-item"><a href="/go/Buying_XOs"><span>Buying</span></a></li><li id="n-Help-using" class="mw-list-item"><a href="/go/Getting_started"><span>Help using</span></a></li><li id="n-Support-for" class="mw-list-item"><a href="/go/Support"><span>Support for</span></a></li><li id="n-Upgrading" class="mw-list-item"><a href="/go/Releases"><span>Upgrading</span></a></li><li id="n-Repairing" class="mw-list-item"><a href="/go/Repair"><span>Repairing</span></a></li><li id="n-Disassembly" class="mw-list-item"><a href="/go/Disassembly"><span>Disassembly</span></a></li></ul> </div> </nav> <nav id="p-About_the_tablet" class="vector-menu mw-portlet mw-portlet-About_the_tablet vector-menu-portal portal" aria-labelledby="p-About_the_tablet-label" role="navigation" > <h3 id="p-About_the_tablet-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">About the tablet</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Specifications" class="mw-list-item"><a href="http://one.laptop.org/about/xo-tablet" rel="nofollow"><span>Specifications</span></a></li><li id="n-Buying" class="mw-list-item"><a href="http://www.walmart.com/ip/24511209" rel="nofollow"><span>Buying</span></a></li><li id="n-Help-using" class="mw-list-item"><a href="http://one.laptop.org/about/xo-tablet-faq" rel="nofollow"><span>Help using</span></a></li><li id="n-Support-for" class="mw-list-item"><a href="http://www.xotablet.com/support/" rel="nofollow"><span>Support for</span></a></li></ul> </div> </nav> <nav id="p-Projects" class="vector-menu mw-portlet mw-portlet-Projects vector-menu-portal portal" aria-labelledby="p-Projects-label" role="navigation" > <h3 id="p-Projects-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Projects</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-for-Educators" class="mw-list-item"><a href="/go/Educators"><span>for Educators</span></a></li><li id="n-for-Developers" class="mw-list-item"><a href="/go/Developers"><span>for Developers</span></a></li><li id="n-Software" class="mw-list-item"><a href="/go/Software_components"><span>Software</span></a></li><li id="n-Hardware" class="mw-list-item"><a href="/go/Hardware"><span>Hardware</span></a></li><li id="n-Activities" class="mw-list-item"><a href="http://activities.sugarlabs.org" rel="nofollow"><span>Activities</span></a></li><li id="n-Deployment-Guide" class="mw-list-item"><a href="/go/Deployment_Guide"><span>Deployment Guide</span></a></li><li id="n-School-Server-(XS)" class="mw-list-item"><a href="/go/School_server"><span>School Server (XS)</span></a></li><li id="n-School-Server-(XSCE)" class="mw-list-item"><a href="/go/XS_Community_Edition"><span>School Server (XSCE)</span></a></li></ul> </div> </nav> <nav id="p-OLPC_wiki" class="vector-menu mw-portlet mw-portlet-OLPC_wiki vector-menu-portal portal" aria-labelledby="p-OLPC_wiki-label" role="navigation" > <h3 id="p-OLPC_wiki-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">OLPC wiki</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Recent-changes" class="mw-list-item"><a href="/go/Special:RecentChanges"><span>Recent changes</span></a></li><li id="n-Glossary" class="mw-list-item"><a href="/go/Glossary"><span>Glossary</span></a></li><li id="n-Random-page" class="mw-list-item"><a href="/go/Special:Random"><span>Random page</span></a></li><li id="n-Help-using-the-wiki" class="mw-list-item"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents"><span>Help using the wiki</span></a></li></ul> </div> </nav> <nav id="p-tb" class="vector-menu mw-portlet mw-portlet-tb vector-menu-portal portal" aria-labelledby="p-tb-label" role="navigation" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="t-whatlinkshere" class="mw-list-item"><a href="/go/Special:WhatLinksHere/Compound_commands" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/go/Special:RecentChangesLinked/Compound_commands" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/go/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/mediawiki/index.php?title=Compound_commands&oldid=267121" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/mediawiki/index.php?title=Compound_commands&action=info" title="More information about this page"><span>Page information</span></a></li></ul> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" role="contentinfo" > <ul id="footer-info"> <li id="footer-info-lastmod"> Last edited on 04:29, 9 March 2012.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="/go/OLPC:Privacy_policy">Privacy</a></li> <li id="footer-places-about"><a href="/go/OLPC:About">About OLPC</a></li> <li id="footer-places-disclaimer"><a href="/go/OLPC:General_disclaimer">Disclaimers</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/"><img src="/mediawiki/resources/assets/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/mediawiki/resources/assets/poweredby_mediawiki_132x47.png 1.5x, /mediawiki/resources/assets/poweredby_mediawiki_176x62.png 2x" width="88" height="31" loading="lazy"/></a></li> </ul> </footer> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.005","walltime":"0.007","ppvisitednodes":{"value":3,"limit":1000000},"postexpandincludesize":{"value":0,"limit":2097152},"templateargumentsize":{"value":0,"limit":2097152},"expansiondepth":{"value":2,"limit":100},"expensivefunctioncount":{"value":0,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":0,"limit":5000000},"timingprofile":["100.00% 0.000 1 -total"]},"cachereport":{"timestamp":"20241130174839","ttl":86400,"transientcontent":false}}});mw.config.set({"wgBackendResponseTime":80});});</script> </body> </html>