{"id":13345,"date":"2019-04-01T21:44:41","date_gmt":"2019-04-01T21:44:41","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13345"},"modified":"2019-04-01T21:44:41","modified_gmt":"2019-04-01T21:44:41","slug":"5-useful-tools-to-remember-linux-commands-forever","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-useful-tools-to-remember-linux-commands-forever\/","title":{"rendered":"5 Useful Tools to Remember Linux Commands Forever"},"content":{"rendered":"<p>There are thousands of tools, utilities, and programs that come pre-installed on a Linux system. You can run them from a terminal window or virtual console as commands via a shell such as Bash.<\/p>\n<p>A command is typically the pathname (eg.\u00a0<strong>\/usr\/bin\/top<\/strong>) or\u00a0<strong>basename<\/strong>\u00a0(e.g\u00a0<a href=\"https:\/\/www.tecmint.com\/12-top-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">top<\/a>) of a program including arguments passed to it. However, there is a common misconception among Linux users that a command is the actual program or tool.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-commands-cheat-sheet\/\" target=\"_blank\" rel=\"noopener\">A \u2013 Z Linux Commands \u2013 Overview with Examples<\/a><\/p>\n<p>Remembering Linux commands and their usage is not easy, especially for new Linux users. In this article, we will share 5 command-line tools for remembering Linux commands.<\/p>\n<h3>1. Bash History<\/h3>\n<p><strong>Bash<\/strong>\u00a0records all unique commands executed by users on the system in a history file. Each user\u2019s bash history file is stored in their home directory (e.g.\u00a0<strong>\/home\/tecmint\/.bash_history<\/strong>\u00a0for user\u00a0<strong>tecmint)<\/strong>. A user can only view his\/her own history file content and root can view the bash history file for all users on a Linux system.<\/p>\n<p>To view your bash history, use the\u00a0<a href=\"https:\/\/www.tecmint.com\/history-command-examples\/\" target=\"_blank\" rel=\"noopener\">history command<\/a>\u00a0as shown.<\/p>\n<pre>$ history  \r\n<\/pre>\n<div id=\"attachment_29687\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/View-User-History-Command.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29687\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/View-User-History-Command.png\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/View-User-History-Command.png 852w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/View-User-History-Command-768x293.png 768w\" alt=\"View User History Command\" width=\"852\" height=\"325\" aria-describedby=\"caption-attachment-29687\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29687\" class=\"wp-caption-text\">View User History Command<\/p>\n<\/div>\n<p>To fetch a command from bash history, press the\u00a0<code>Up<\/code>\u00a0arrow key continuously to search through a list of all unique commands that you run previously. If you have skipped the command your looking for or failed to get it, use the\u00a0<code>Down<\/code>\u00a0arrow key to perform a reverse search.<\/p>\n<p>This bash feature is one of the many ways of easily remembering Linux commands. You can find more examples of the\u00a0<strong>history command<\/strong>\u00a0in these articles:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/history-command-examples\/\" target=\"_blank\" rel=\"noopener\">The Power of Linux \u201cHistory Command\u201d in Bash Shell<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/clear-command-line-history-in-linux\/\" target=\"_blank\" rel=\"noopener\">How to Clear BASH Command Line History in Linux<\/a><\/li>\n<\/ol>\n<h3>2. Friendly Interactive Shell (Fish)<\/h3>\n<p><a href=\"https:\/\/www.tecmint.com\/fish-a-smart-and-user-friendly-interactive-shell-for-linux\/\" target=\"_blank\" rel=\"noopener\">Fish<\/a>\u00a0is a modern, powerful, user-friendly, feature-rich and interactive shell which is compatible to\u00a0<strong>Bash<\/strong>\u00a0or\u00a0<strong>Zsh<\/strong>. It supports automatic suggestions of file names and commands in the current directory and history respectively, which helps you to easily remember commands.<\/p>\n<p>In the following screenshot, the command \u201c<strong>uname -r<\/strong>\u201d is in the bash history, to easily remember it, type the later\u00a0<code>\u201cu\u201d<\/code>\u00a0or\u00a0<code>\u201cun\u201d<\/code>\u00a0and fish will auto-suggest the complete command. If the command auto-suggested is the one you wish to run, use the\u00a0<strong>Right<\/strong>\u00a0arrow key to select it and run it.<\/p>\n<div id=\"attachment_29688\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/run-fish-shell.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29688\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/run-fish-shell.png\" alt=\"Fish - Friendly Interactive Shell\" width=\"682\" height=\"154\" aria-describedby=\"caption-attachment-29688\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29688\" class=\"wp-caption-text\">Fish \u2013 Friendly Interactive Shell<\/p>\n<\/div>\n<p>Fish is a fully-fledged shell program with a wealth of features for you to remember Linux commands in a straightforward manner.<\/p>\n<h3>3. Apropos Tool<\/h3>\n<p><strong>Apropos<\/strong>\u00a0searches and displays the name and short description of a keyword, for instance a command name, as written in the man page of that command.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/find-linux-command-description-and-location\/\" target=\"_blank\" rel=\"noopener\">5 Ways to Find a Linux Command Description and Location<\/a><\/p>\n<p>If you do not know the exact name of a command, simply type a keyword (regular expression) to search for it. For example if you are searching for the description of\u00a0<strong>docker-commit<\/strong>\u00a0command, you can type\u00a0<strong>docker<\/strong>, apropos will search and list all commands with the string docker, and their description as well.<\/p>\n<pre>$ apropos docker\r\n<\/pre>\n<div id=\"attachment_29689\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Find-Linux-Command-Description.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29689\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/Find-Linux-Command-Description.png\" alt=\"Find Linux Command Description\" width=\"722\" height=\"382\" aria-describedby=\"caption-attachment-29689\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29689\" class=\"wp-caption-text\">Find Linux Command Description<\/p>\n<\/div>\n<p>You can get the description of the exact keyword or command name you have provided as shown.<\/p>\n<pre>$ apropos docker-commit\r\nOR\r\n$ apropos -a docker-commit\r\n<\/pre>\n<p>This is another useful way of remembering Linux commands, to guide you on what command to use for a specific task or if you have forgotten what a command is used for. Read on, because the next tool is even more interesting.<\/p>\n<h3>4. Explain Shell Script<\/h3>\n<p><a href=\"https:\/\/www.tecmint.com\/explain-shell-commands-in-the-linux-shell\/\" target=\"_blank\" rel=\"noopener\">Explain Shell<\/a>\u00a0is a small Bash script that explains shell commands. It requires the\u00a0<strong>curl<\/strong>\u00a0program and a working internet connection. It displays a command description summary and in addition, if the command includes a flag, it also shows a description of that flag.<\/p>\n<p>To use it, first you need to add the following code at the bottom of you\u00a0<code>$HOME\/.bashrc<\/code>\u00a0file.<\/p>\n<pre># explain.sh begins\r\nexplain () {\r\n  if [ \"$#\" -eq 0 ]; then\r\n    while read  -p \"Command: \" cmd; do\r\n      curl -Gs \"https:\/\/www.mankier.com\/api\/explain\/?cols=\"$(tput cols) --data-urlencode \"q=$cmd\"\r\n    done\r\n    echo \"Bye!\"\r\n  elif [ \"$#\" -eq 1 ]; then\r\n    curl -Gs \"https:\/\/www.mankier.com\/api\/explain\/?cols=\"$(tput cols) --data-urlencode \"q=$1\"\r\n  else\r\n    echo \"Usage\"\r\n    echo \"explain                  interactive mode.\"\r\n    echo \"explain 'cmd -o | ...'   one quoted command to explain it.\"\r\n  fi\r\n}\r\n<\/pre>\n<p>Save and close the file, then source it or open a fresh terminal windows.<\/p>\n<pre>$ source .bashrc\r\n<\/pre>\n<p>Assuming you have forgotten what the command\u00a0<strong>\u201capropos -a\u201d<\/strong>\u00a0does, you can use explain command to help you remember it, as shown.<\/p>\n<pre>$ explain 'apropos -a'\r\n<\/pre>\n<div id=\"attachment_29690\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/run-explain-shell-script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29690\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/06\/run-explain-shell-script.png\" alt=\"Show Linux Command Manual\" width=\"722\" height=\"287\" aria-describedby=\"caption-attachment-29690\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29690\" class=\"wp-caption-text\">Show Linux Command Manual<\/p>\n<\/div>\n<p>This script can explain to you any shell command effectively, thus helping you remember Linux commands. Unlike the explain shell script, the next tool brings a distinct approach, it shows usage examples of a command.<\/p>\n<h3>5. Cheat Program<\/h3>\n<p><a href=\"https:\/\/www.tecmint.com\/cheat-command-line-cheat-sheet-for-linux-users\/\" target=\"_blank\" rel=\"noopener\">Cheat<\/a>\u00a0is a simple, interactive command-line cheat-sheet program which shows use cases of a Linux command with a number of options and their short understandable function. It is useful for Linux newbies and sysadmins.<\/p>\n<p>To install and use it, check out our complete article about Cheat program and its usage with examples:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/cheat-command-line-cheat-sheet-for-linux-users\/\" target=\"_blank\" rel=\"noopener\">Cheat \u2013 An Ultimate Command Line \u2018Cheat-Sheet\u2019 for Linux Beginners<\/a><\/li>\n<\/ol>\n<p>That\u2019s all! In this article, we have shared 5 command-line tools for remembering Linux commands. If you know any other tools for the same purpose that are missing in the list above, let us know via the feedback form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/remember-linux-commands\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are thousands of tools, utilities, and programs that come pre-installed on a Linux system. You can run them from a terminal window or virtual console as commands via a shell such as Bash. A command is typically the pathname (eg.\u00a0\/usr\/bin\/top) or\u00a0basename\u00a0(e.g\u00a0top) of a program including arguments passed to it. However, there is a common &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/5-useful-tools-to-remember-linux-commands-forever\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;5 Useful Tools to Remember Linux Commands Forever&#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-13345","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\/13345","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=13345"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13345\/revisions"}],"predecessor-version":[{"id":13346,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13345\/revisions\/13346"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}