{"id":6887,"date":"2018-09-17T20:03:53","date_gmt":"2018-09-17T16:03:53","guid":{"rendered":"https:\/\/www.howtoforge.com\/linux-pinky-command\/"},"modified":"2018-09-17T20:03:53","modified_gmt":"2018-09-17T16:03:53","slug":"linux-pinky-command-tutorial-for-beginners-8-examples","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/linux-pinky-command-tutorial-for-beginners-8-examples\/","title":{"rendered":"Linux pinky Command Tutorial for Beginners (8 Examples)"},"content":{"rendered":"<p>The finger command in Linux is a popular tool to fetch information related to system users. However, this utility doesn&#8217;t come pre-installed with all Linux distributions. For example, Ubuntu 18.04 LTS doesn&#8217;t come with it out of the box. While you can always download and use the finger command, there&#8217;s a lightweight alternative that comes pre-installed (at least on Ubuntu).<\/p>\n<p>The tool in question is called pinky. In this article, we will discuss the basics of pinky using some easy to understand examples. But before we do 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-pinky-command\">Linux pinky command<\/h2>\n<p>The man page for pinky explains it just as:<\/p>\n<pre>\u00a0pinky - lightweight finger<\/pre>\n<p>Here&#8217;s is the tool&#8217;s syntax:<\/p>\n<p class=\"command\">pinky [OPTION]&#8230; [USER]&#8230;<\/p>\n<p>And following are some Q&amp;A-styled examples that should give you an even better idea on how the pinky tool works.<\/p>\n<h2 id=\"q-how-pinky-works\">Q1. How pinky works?<\/h2>\n<p>Basic usage is simple, just execute &#8216;pinky&#8217; sans any argument.<\/p>\n<p class=\"command\">pinky<\/p>\n<p>Here&#8217;s the output this command produced on my system:<\/p>\n<pre>Login\u00a0\u00a0\u00a0 Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TTY\u00a0\u00a0\u00a0\u00a0\u00a0 Idle\u00a0\u00a0 When\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Where<br\/>himanshu Himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?????\u00a0 2018-09-04 09:31 :0<\/pre>\n<p>So you can see the output contains information like the user&#8217;s login name, real\/full name, terminal, login time, and remote host. By default, the output produced is for the current user. Of course, you can use pinky to fetch information for other users as well &#8211; in that case, you&#8217;ll have specify the user name.<\/p>\n<p class=\"command\">pinky USERNAME<\/p>\n<h2 id=\"q-how-to-make-pinky-produce-long-format-output\">Q2. How to make pinky produce long format output?<\/h2>\n<p>This can be done using the -l command line option.<\/p>\n<p class=\"command\">pinky -l<\/p>\n<p>Following output was produced by this command on my system:<\/p>\n<pre>Login name: himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 In real life:\u00a0 Himanshu<br\/>Directory: \/home\/himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Shell:\u00a0 \/bin\/bash<\/pre>\n<p>Note that the -l option requires you to mention the user name &#8211; in other words, mentioning username is mandatory in this case.<\/p>\n<h2 id=\"q-how-to-omit-home-directory-and-shell-info-in-long-format\">Q3. How to omit home directory and shell info in long format?<\/h2>\n<p>This can be achieved by clubbing the -b option with the -l option.<\/p>\n<p class=\"command\">pinky -lb himanshu<\/p>\n<p>Following is the output:<\/p>\n<pre>Login name: himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 In real life:\u00a0 Himanshu<\/pre>\n<p>So you can see that the directory and shell related information wasn&#8217;t produced in output this time around. Similarly you can use the -h and -p options to remove the user&#8217;s project file and plan file information (if available), respectively, in the long format.<\/p>\n<h2 id=\"q-how-to-make-pinky-remove-column-headings\">Q4. How to make pinky remove column headings?<\/h2>\n<p>This can be done using the -f command line option.<\/p>\n<p>For example, this command:<\/p>\n<p class=\"command\">pinky -f himanshu<\/p>\n<p>produced the following output on my system:<\/p>\n<pre>himanshu Himanshu\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?????\u00a0 2018-09-04 09:31 :0<\/pre>\n<p>So as you can see, the column headers were removed in the output.<\/p>\n<h2 id=\"q-how-to-make-pinky-omit-users-full-name-in-output\">Q5. How to make pinky omit user&#8217;s full name in output?<\/h2>\n<p>This can be done using the -w command line option.<\/p>\n<p>For example, this:<\/p>\n<p class=\"command\">pinky -w himanshu<\/p>\n<p>produced the following output:<\/p>\n<pre>Login\u00a0\u00a0\u00a0\u00a0 TTY\u00a0\u00a0\u00a0\u00a0\u00a0 Idle\u00a0\u00a0 When\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Where<br\/>himanshu ?:0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ?????\u00a0 2018-09-04 09:31 :0<\/pre>\n<p>So you can see the column entry for full name was omitted from output. There are two other options that do similar stuff:<\/p>\n<pre readability=\"6\">-i omit the user's full name and remote host in short format<p>-q omit\u00a0 the\u00a0 user's\u00a0 full name, remote host and idle time in short format<\/p><\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>As you&#8217;d likely agree, pinky is a handy little tool for those who work with system users&#8217; information. In this article, we have discussed majority of the tool&#8217;s options. Once you are done practicing these, head to pinky&#8217;s\u00a0<a href=\"https:\/\/linux.die.net\/man\/1\/pinky\" target=\"_blank\" rel=\"noopener noreferrer\">man page<\/a> to learn more about the command.<\/p>\n<div class=\"authorbox\" readability=\"15\">\n<img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/linux-pinky-command-tutorial-for-beginners-8-examples.jpg\" alt=\"Himanshu Arora\" title=\"\"> <\/p>\n<p><strong>About Himanshu Arora<\/strong><\/p>\n<p>Himanshu Arora has been working on Linux since 2007. He carries professional experience in system level programming, networking protocols, and command line. In addition to HowtoForge, Himanshu&#8217;s work has also been featured in some of world&#8217;s other leading publications including Computerworld, IBM DeveloperWorks, and Linux Journal.<\/p>\n<\/div>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Flinux-pinky-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/linux-pinky-command-tutorial-for-beginners-8-examples.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Flinux-pinky-command%2F&amp;text=Linux+pinky+Command+Tutorial+for+Beginners+%288+Examples%29&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/linux-pinky-command-tutorial-for-beginners-8-examples-1.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/linux-pinky-command-tutorial-for-beginners-8-examples-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Flinux-pinky-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/09\/linux-pinky-command-tutorial-for-beginners-8-examples-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The finger command in Linux is a popular tool to fetch information related to system users. However, this utility doesn&#8217;t come pre-installed with all Linux distributions. For example, Ubuntu 18.04 LTS doesn&#8217;t come with it out of the box. While you can always download and use the finger command, there&#8217;s a lightweight alternative that comes &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-6887","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6887","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=6887"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6887\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=6887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=6887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=6887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}