<p>All commandline applications shipped with Haiku are in <spanclass="path">/boot/system/bin/</span>. Your own or additionally installed commandline apps will appear there as well, or in <spanclass="path">~/config/bin/</span>, when installed from a .hpkg package. Otherwise you can put them into <spanclass="path">/boot/system/non-packaged/bin/</span> or <spanclass="path">~/config/non-packaged/bin/</span>. All these locations are part of the PATH variable and are therefore automatically found.<br/>
The following isn't an exhaustive list of all Haiku-specific CLI apps, it serves just to highlight a few of the most useful to give you a taste. Feel encouraged to explore what's in the <spanclass="path">bin/</span> folders on your own a bit. Executing an app with the parameter <tt>--help</tt> shows the usage of the command and all its various options.</p>
<aid="cli-attributes"name="cli-attributes">Relating to attributes: <spanclass="cli">listattr</span>, <spanclass="cli">catattr</span>, <spanclass="cli">addattr</span>, <spanclass="cli">rmattr</span>, <spanclass="cli">copyattr</span></a></h3>
<p>These commands are used to display, read out, add and remove attributes of files. Remember that these meta data are currently only available on BFS formatted volumes. Moving files onto other file systems will strip all attributes!<br/>
All these commands are described in topic <ahref="../attributes.html#attributes-terminal">Attributes in Terminal</a>.</p>
<aid="cli-index"name="cli-index">Relating to the index: <spanclass="cli">lsindex</span>, <spanclass="cli">mkindex</span>, <spanclass="cli">reindex</span>, <spanclass="cli">rmindex</span></a></h3>
<p>With these commands you list, make, reindex and remove attributes to BFS' index. Every volume has it's own index, remember that when copying files from one volume to another.<br/>
These commands are described in topic <ahref="../index.html">Index</a>.</p>
<aid="cli-pkg"name="cli-pkg">Relating to package management: <spanclass="cli">package</span>, <spanclass="cli">pkgman</span></a></h3>
<p>The <spanclass="cli">package</span> command is used to manage HPKG packages. Have a look at the article <ahref="https://www.haiku-os.org/guides/daily-tasks/install-applications">Installing applications</a> to learn the very basics. Usually the tool <ahref="https://github.com/haikuports/haikuports/wiki">haikuporter</a> is used to create so-called recipes for automatic package building.</p>
<p><spanclass="cli">pkgman</span> is used to search, install, update and uninstall packages. Package repositories can be added, dropped and their package lists refreshed. A special kind of update is invoked with the parameter <tt>full-sync</tt>: It is more aggressive and also downgrades or removes packages, if necessary.<br/>
For more details on a parameter, append "--help", e.g. <tt>pkgman search --help</tt>.</p>
<p>Here are a few commandline tools that are especially useful for scripting (see also topic <ahref="../bash-scripting.html">Bash and Scripting</a>).</p>
<tdvalign="top"><p><spanclass="cli">alert</span> conjures up the typical alert window with a pre-defined icon, explanatory text and up to three buttons. It will return the title of the pressed button and an exit status (starting with 0). For example, this is made of the line:</p>
<tdvalign="top"><p><spanclass="cli">filepanel</span> displays a load or save file panel and lets the user choose a file or location. As a return value you'll get the chosen file or folder's path. There are several parameters available, for example to set a starting directory, a window title, a default name when saving or restrictions to the allowed types of files. This is an example of</p>
<preclass="terminal">filepanel -s -t "Save your logfile" -d ~/config/settings -n Fantastic.log</pre>
<tdvalign="top"><p><spanclass="cli">hey</span> is a littler helper tool that sends BMessages to applications and prints out their answer. It can be used for application scripting, i.e. "remote controlling" a program from a script or the command line. It's usage is a bit complex... Thanks to Scot Hacker's BeOS Bible, there's a nice <ahref="http://www.birdhouse.org/beos/bible/bos/ch_scripting6.html">hey tutorial</a> by Chris Herborth.</p>
<tdvalign="top"><p><spanclass="cli">query</span> is the commandline version of the Find panel. In fact, a quick way to generate the search term is to build a query in the Find panel, switch to <spanclass="menu">by formula</span>, add double quotes (<tt>"</tt>) in front and back and paste the whole string after your <spanclass="cli">query</span> command in Terminal or your script.</p>
<td><p><spanclass="cli">checkfs</span> is an important tool to check for errors in your file system. Simply add a volume name like <spanclass="path">/Haiku</span> or device path and it'll run through every file and correct inconsistencies where possible.</p>
<tdvalign="top"><p><spanclass="cli">desklink</span> can install an icon for any file, folder, query or application in the Deskbar tray. It also offers the option to provide a context menu when right-clicking an icon to execute special actions. As an example, try this to add the commandline app <spanclass="app">screenshot</span> with various options (the "<tt>\</tt>" in the first line is just for the line break in Terminal):</p>
<tdvalign="top"><p><spanclass="cli">diskimage</span> lets you register a regular file as disk device. For example, you can register a Haiku anyboot image, mount it in Tracker and copy, edit or remove files there before using it as source in the Installer.</p>
<tdvalign="top"><p><spanclass="cli">mountvolume</span> is preferred by many to mount local partitions and disks, because its usage is so easy: just call it with the name of the partition and you're done. Try <tt>--help</tt> for more options.</p>
<p><spanclass="cli">mount</span> can additionally mount remote disks by using a network filesystem, like NFS4. You specify the used filesystem with the <tt>-t</tt> parameter and the remote location with the <tt>-p</tt> parameter. As filesystem parameter you can use anything you find in <spanclass="path">/system/add-ons/kernel/file_system</span> (and corresponding file hierarchies under <spanclass="path">~/config</span> or "<spanclass="path">non-packaged</span>", of course). You also have to create a folder as mountpoint. Here's an example:</p>
<preclass="terminal">mkdir -p /DiskStation
mount -t nfs4 -p "192.168.178.3:volume1" /DiskStation</pre></td></tr>
<tdvalign="top"><p><spanclass="cli">open</span> is a very handy little tool. With it you open any file with its preferred application, or start a specific application by its signature without the need to know its exact path. It also works with URLs and even with the "virtual" directories <tt>.</tt> for the current directory and <tt>..</tt> for the parent, opening the folder in Tracker.</p>