{"id":13349,"date":"2019-04-01T21:51:46","date_gmt":"2019-04-01T21:51:46","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13349"},"modified":"2019-04-01T21:51:46","modified_gmt":"2019-04-01T21:51:46","slug":"5-ways-to-find-a-binary-command-description-and-location-on-file-system","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-ways-to-find-a-binary-command-description-and-location-on-file-system\/","title":{"rendered":"5 Ways to Find a \u2018Binary Command\u2019 Description and Location on File System"},"content":{"rendered":"<p>With the thousands of\u00a0<a href=\"https:\/\/www.tecmint.com\/category\/top-tools\/\" target=\"_blank\" rel=\"noopener\">commands\/programs available in Linux systems<\/a>, knowing the type and purpose of a given command as well as its location (absolute path) on the system can be a little challenge for newbies.<\/p>\n<p>Knowing a few details of commands\/programs not only helps a\u00a0<a href=\"https:\/\/www.tecmint.com\/tag\/linux-tricks\/\" target=\"_blank\" rel=\"noopener\">Linux user master the numerous commands<\/a>, but it also enables a user understand what operations on the system to use them for, either from the command line or a script.<\/p>\n<p>Therefore, in this article we will explain to you five useful commands for showing a short description and the location of a given command.<\/p>\n<p>To discover new commands on your system look into all the directories in your\u00a0<strong>PATH<\/strong>\u00a0environmental variable. These directories store all the installed commands\/programs on the system.<\/p>\n<p>Once you find an interesting command name, before you proceed to read more about it probably in the man page, try to gather some shallow information about it as follows.<\/p>\n<p>Assuming you have echoed the values of\u00a0<strong>PATH<\/strong>\u00a0and moved into the directory\u00a0<strong>\/usr\/local\/bin<\/strong>\u00a0and noticed a new command called\u00a0<a href=\"https:\/\/www.tecmint.com\/fswatch-monitors-files-and-directory-changes-modifications-in-linux\/\" target=\"_blank\" rel=\"noopener\">fswatch (monitors file modification changes)<\/a>:<\/p>\n<pre>$ echo $PATH\r\n$ cd \/usr\/local\/bin\r\n<\/pre>\n<div id=\"attachment_24057\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-New-Commands-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24057\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-New-Commands-in-Linux.png\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-New-Commands-in-Linux.png 847w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-New-Commands-in-Linux-768x201.png 768w\" alt=\"Find New Commands in Linux\" width=\"847\" height=\"222\" aria-describedby=\"caption-attachment-24057\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24057\" class=\"wp-caption-text\">Find New Commands in Linux<\/p>\n<\/div>\n<p>Now let\u2019s find out the description and location of the\u00a0<strong>fswatch<\/strong>\u00a0command using following different ways in Linux.<\/p>\n<h3>1. whatis Command<\/h3>\n<p><strong>whatis<\/strong>\u00a0is used to display one-line manual page descriptions of the command name (such as\u00a0<strong>fswatch<\/strong>\u00a0in the command below) you enter as an argument.<\/p>\n<p>If the description is too long some parts are trimmed of by default, use the\u00a0<code>-l<\/code>\u00a0flag to show a complete description.<\/p>\n<pre>$ whatis fswatch\r\n$ whatis -l fswatch\r\n<\/pre>\n<div id=\"attachment_24058\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Whatis-Command-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24058\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Whatis-Command-Example.png\" alt=\"Linux whatis Command Example\" width=\"761\" height=\"156\" aria-describedby=\"caption-attachment-24058\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24058\" class=\"wp-caption-text\">Linux whatis Command Example<\/p>\n<\/div>\n<h3>2. apropos Command<\/h3>\n<p><strong>apropos<\/strong>\u00a0searches for the manual page names and descriptions of the keyword (considered a\u00a0<strong>regex<\/strong>, which is the command name) provided.<\/p>\n<p>The\u00a0<code>-l<\/code>\u00a0option enables showing of the compete description.<\/p>\n<pre>$ apropos fswatch \r\n$ apropos -l fswatch\r\n<\/pre>\n<div id=\"attachment_24059\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-apropos-Command-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24059\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-apropos-Command-Example.png\" alt=\"Linux apropos Command Example\" width=\"759\" height=\"156\" aria-describedby=\"caption-attachment-24059\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24059\" class=\"wp-caption-text\">Linux apropos Command Example<\/p>\n<\/div>\n<p>By default, apropos may show an output of all matched lines, as in the example below. You can only match the exact keyword using the\u00a0<code>-e<\/code>\u00a0switch:<\/p>\n<pre>$ apropos fmt\r\n$ apropos -e fmt\r\n<\/pre>\n<div id=\"attachment_24060\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-apropos-Command-Keyword-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24060\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-apropos-Command-Keyword-Example.png\" alt=\"Linux apropos Command Show by Keyword\" width=\"762\" height=\"332\" aria-describedby=\"caption-attachment-24060\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24060\" class=\"wp-caption-text\">Linux apropos Command Show by Keyword<\/p>\n<\/div>\n<h3>3. type Command<\/h3>\n<p><strong>type<\/strong>\u00a0tells you the full pathname of a given command, additionally, in case the command name entered is not a program that exists as a separate disk file, type also tells you the command classification:<\/p>\n<ol>\n<li>Shell built-in command or<\/li>\n<li>Shell keyword or reserved word or<\/li>\n<li>An alias<\/li>\n<li><\/li>\n<\/ol>\n<pre>$ type fswatch \r\n<\/pre>\n<div id=\"attachment_24061\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-type-Command-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24061\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-type-Command-Example.png\" alt=\"Linux type Command Example\" width=\"543\" height=\"68\" aria-describedby=\"caption-attachment-24061\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24061\" class=\"wp-caption-text\">Linux type Command Example<\/p>\n<\/div>\n<p>When the command is an alias for another command,\u00a0<strong>type<\/strong>\u00a0shows the command executed when the alias is run. Use the\u00a0<strong>alias<\/strong>\u00a0command to view all aliases created on your system:<\/p>\n<pre>$ alias\r\n$ type l\r\n$ type ll\r\n<\/pre>\n<div id=\"attachment_24062\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Show-All-Aliases-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24062\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Show-All-Aliases-in-Linux.png\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Show-All-Aliases-in-Linux.png 796w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Show-All-Aliases-in-Linux-768x342.png 768w\" alt=\"Show All Aliases in Linux\" width=\"796\" height=\"354\" aria-describedby=\"caption-attachment-24062\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24062\" class=\"wp-caption-text\">Show All Aliases in Linux<\/p>\n<\/div>\n<h3>4. which Command<\/h3>\n<p><strong>which<\/strong>\u00a0helps to locate a command, it prints the absolute command path as below:<\/p>\n<pre>$ which fswatch \r\n<\/pre>\n<div id=\"attachment_24063\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-Linux-Command-Location.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24063\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Find-Linux-Command-Location.png\" alt=\"Find Linux Command Location\" width=\"547\" height=\"68\" aria-describedby=\"caption-attachment-24063\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24063\" class=\"wp-caption-text\">Find Linux Command Location<\/p>\n<\/div>\n<p>Some binaries can be stored in more than one directory under the\u00a0<strong>PATH<\/strong>, use the\u00a0<code>-a<\/code>\u00a0flag to show all matching pathnames.<\/p>\n<h3>5. whereis Command<\/h3>\n<p><strong>whereis<\/strong>\u00a0command locates the binary, source, and manual page files for the command name provided as follows:<\/p>\n<pre>$ whereis fswatch\r\n$ whereis mkdir \r\n$ whereis rm\r\n<\/pre>\n<div id=\"attachment_24065\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-whereis-Command-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-24065\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-whereis-Command-Example.png\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-whereis-Command-Example.png 879w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/01\/Linux-whereis-Command-Example-768x175.png 768w\" alt=\"Linux whereis Command Example\" width=\"879\" height=\"200\" aria-describedby=\"caption-attachment-24065\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-24065\" class=\"wp-caption-text\">Linux whereis Command Example<\/p>\n<\/div>\n<p>Although the commands above may be vital in finding some quick info about a command\/program, opening and reading through its manual page always provides a full documentation, including a list of other related programs:<\/p>\n<pre>$ man fswatch\r\n<\/pre>\n<p>In this article, we reviewed five simple commands used to display short manual page descriptions and location of a command. You can make a contribution to this post or ask a question via the feedback section below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/find-linux-command-description-and-location\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the thousands of\u00a0commands\/programs available in Linux systems, knowing the type and purpose of a given command as well as its location (absolute path) on the system can be a little challenge for newbies. Knowing a few details of commands\/programs not only helps a\u00a0Linux user master the numerous commands, but it also enables a user &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-ways-to-find-a-binary-command-description-and-location-on-file-system\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;5 Ways to Find a \u2018Binary Command\u2019 Description and Location on File System&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13349","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13349"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13349\/revisions"}],"predecessor-version":[{"id":13350,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13349\/revisions\/13350"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}