{"id":7351,"date":"2018-11-27T13:42:03","date_gmt":"2018-11-27T10:42:03","guid":{"rendered":"https:\/\/www.howtoforge.com\/linux-finger-command\/"},"modified":"2018-11-27T13:42:03","modified_gmt":"2018-11-27T10:42:03","slug":"linux-finger-command-tutorial-for-beginners-5-examples","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/linux-finger-command-tutorial-for-beginners-5-examples\/","title":{"rendered":"Linux finger Command Tutorial for Beginners (5 Examples)"},"content":{"rendered":"<div><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-finger-command-tutorial-for-beginners-5-examples.jpg\" class=\"ff-og-image-inserted\" alt=\"\" title=\"\"><\/div>\n<p>If you are a Linux system admin, or your work involves managing users, there are many tools that you should be aware of. Once such command line utility is <strong>finger<\/strong>, basics of which we&#8217;ll be discussing here in this tutorial. But before we start with that, it&#8217;s worth mentioning that all examples here have been tested on an Ubuntu 18.04 LTS machine.<\/p>\n<h2 id=\"linux-finger-command\">Linux finger command<\/h2>\n<p>The finger command in Linux is basically a user information lookup program. Following is its syntax:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">finger [-lmsp] [user ...] [<a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"1d686e786f5d75726e69\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a> ...]<\/code><\/pre>\n<p>And here&#8217;s how the tool&#8217;s man page explains it:<\/p>\n<pre><code spellcheck=\"false\">The finger displays information about the system users.<\/code><\/pre>\n<p>Following are some Q&amp;A styled examples that should give you a better idea on how the finger command works.<\/p>\n<h2 id=\"q-how-to-use-finger-command\">Q1. How to use finger command?<\/h2>\n<p>Basic usage is simple, just execute &#8216;finger&#8217; with name of a user as input. Here&#8217;s an example:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">finger himanshu<\/code><\/pre>\n<p>And here&#8217;s the output the above command produced on my system:<\/p>\n<pre><code spellcheck=\"false\">Login: himanshu\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Name: Himanshu<br\/>Directory: \/home\/himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Shell: \/bin\/bash<br\/>On since Sat Nov 24 10:16 (IST) on :0 from :0 (messages off)<br\/>No mail.<br\/>No Plan.<\/code><\/pre>\n<h2 id=\"q-how-to-make-finger-display-output-columns-wise\">Q2. How to make finger display output columns wise?<\/h2>\n<p>This can be done using the -s command line option. Here&#8217;s an example:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">finger -s himanshu<\/code><\/pre>\n<p>And here&#8217;s the output produced:<\/p>\n<pre><code spellcheck=\"false\">Login\u00a0\u00a0\u00a0\u00a0 Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tty\u00a0\u00a0\u00a0\u00a0\u00a0 Idle\u00a0 Login Time\u00a0\u00a0 Office\u00a0\u00a0\u00a0\u00a0 Office Phone<br\/>himanshu\u00a0 Himanshu\u00a0 *:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Nov 24 10:16 (:0)<\/code><\/pre>\n<h2 id=\"q-how-to-make-finger-restrict-some-info-in-output\">Q3. How to make finger restrict some info in output?<\/h2>\n<p>There&#8217;s a command line option -p that forces finger to not display the contents of the \u201c.plan\u201d, \u201c.project\u201d and \u201c.pgpkey\u201d files. Here&#8217;s an example:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">finger -p himanshu<\/code><\/pre>\n<p>And here&#8217;s the output:<\/p>\n<pre><code spellcheck=\"false\">Login: himanshu\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Name: Himanshu<br\/>Directory: \/home\/himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Shell: \/bin\/bash<br\/>On since Sat Nov 24 10:16 (IST) on :0 from :0 (messages off)<br\/>No mail.<\/code><\/pre>\n<p>So you can see info related to &#8216;plan&#8217; was not displayed in the output.<\/p>\n<h2 id=\"q-how-to-prevent-matching-of-user-real-names\">Q4. How to prevent matching of user real names?<\/h2>\n<p>By default, the input user name you provide is matched for user login names as well as real names. But if you want, you can disable the latter matching using the -m command line option.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">finger -m himanshu<\/code><\/pre>\n<h2 id=\"q-what-are-some-other-points-worth-knowing-about-finger\">Q5. What are some other points worth knowing about finger?<\/h2>\n<p>Here&#8217;s a\u00a0relevant excerpt from the tool&#8217;s man page:<\/p>\n<pre readability=\"10.762304921969\"><code spellcheck=\"false\" readability=\"15.654261704682\">If no options are specified, finger defaults to the -l style output if operands are provided, <br\/>otherwise to the -s style.\u00a0 Note that some fields may be missing, in either format, if information <br\/>is not available for them.<p>If no arguments are specified, finger will print an entry for each user currently logged into the <br\/>system.<\/p><p>Finger may be used to look up users on a remote machine.\u00a0 The format is to specify a user as <br\/>\u201c<a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"dbaea8bea99bb3b4a8af\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a>\u201d, or \u201c@host\u201d, where the default output format for the former is the -l style, and the <br\/>default output format for the latter is the -s style.\u00a0 The -l option is the only option that may <br\/>be passed to a remote machine.<\/p><p>If standard output is a socket, finger will emit a carriage return (^M) before every linefeed (^J).<br\/>This is for processing remote finger requests when invoked by fingerd(8).<\/p><\/code><\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Depending on the kind of work you do on your Linux box, the\u00a0finger command may be of great help to you. Head to the tool&#8217;s\u00a0<a href=\"https:\/\/linux.die.net\/man\/1\/finger\" target=\"_blank\" rel=\"noopener noreferrer\">man page<\/a> to learn more about it. And as for alternatives, you can check out the <a href=\"https:\/\/www.howtoforge.com\/linux-pinky-command\/\" target=\"_blank\" rel=\"noopener noreferrer\">Pinky command<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are a Linux system admin, or your work involves managing users, there are many tools that you should be aware of. Once such command line utility is finger, basics of which we&#8217;ll be discussing here in this tutorial. But before we start with that, it&#8217;s worth mentioning that all examples here have been [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7351","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7351"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7351\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}