In this chapter I will talk about getting help. This section covers ways to get help, and also includes links to several tutorials and books which I found useful for getting to learn the command-line, or improve at it.

Manual Pages

Also referred to as "man pages", these are text-based help files for standard commands. Man pages are hard for beginners but they usually contain all the help one could get about a command: arguments, examples etc.

To invoke a man page for a certain command, you would normally do man COMMAND. For example, let's try man bash, which will open the Bash man page.

Man pages are organized in sections. Most commands are in the first section. To open a man page located in section 3 for example, you would do man 3 COMMAND. Unless the section is specified like in the previous example, man will search for commands in order, first in the first section, then if the command is not found, in the second section and so on. Keep in mind that there are man pages with the same name in different sections. For example, man 1 printf will document the /usr/bin/printf command, while man 3 printf will document the C function (section 3 holds man pages for library calls). To see a list of available sections, type man man and look under Description.
To navigate up and down in a man page, you can use the arrow keys, Ctrl+P or Ctrl+N, or J and K keys. Once done, quit the man page using Q.

Below is a list of sections and the type of man pages they contain, as described in man man:

  • 1 Executable programs or shell commands
  • 2 System calls (functions provided by the kernel)
  • 3 Library calls (functions within program libraries)
  • 4 Special files (usually found in /dev)
  • 5 File formats and conventions eg /etc/passwd
  • 6 Games
  • 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
  • 8 System administration commands (usually only for root)
  • 9 Kernel routines [Non standard]
To access a man page from section 3 you would do something like man 3 fprintf.

Short Help

All of the GNU commands (the standard commands like tar or bash) and most other commands and programs offer a command-line help when invoked with the -h, --help or --usage arguments. This help provides only a description and the use of the most important arguments that the command takes. Here's an example of how it looks (this is just an excerpt, lines have been removed to save space):
$ tar --help
Usage: tar [OPTION...] [FILE]...
GNU 'tar' saves many files together into a single tape or disk archive, and can
restore individual files from the archive.

Examples:
  tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.

  -c, --create               create a new archive
  -d, --diff, --compare      find differences between archive and file system
      --delete               delete from the archive (not on mag tapes!)
  -r, --append               append files to the end of an archive
Keep in mind that although most of the programs do, some don't offer help this way. For example, commands like ls or mkdir don't work with the -h switch, you will have to use --help. Some programs don't offer help at all when invoked with these arguments. This depends on the creators of the respective program.

IRC

The Internet Relay Chat (or IRC for short) is a protocol which allows you to chat with other persons in real-time. IRC has been around for many years, since 1988 when it was invented. IRC uses networks and the concept of channels (which are like chat rooms from other services).

Most open-source projects have a dedicated IRC channel, where you can find other users who can help you with a particular task. For example, the Freenode network is the home of pretty much all the distributions, programming languages or other open-source projects. You can even help development, talk to developers or follow the development status of some projects on IRC. You can join channels like #ubuntu or #debian (on OFTC as well) for distro-specific help, you can join channels like #bash, #c or #perl for help in those programming languages as well.

To use IRC, you will need an IRC client, which is an application that uses this protocol. Such clients are graphical ones like XChat, HexChat, Quassel IRC, Konversation, and even Pidgin, or command-line ones like Irssi.

Forums

Usually every distribution has a forum which includes a sub-forum dedicated to the terminal and command-line. Some recommended forums are Ubuntu Forums, Linux Mint Forums, Linux Questions Forums.

Wiki

Wikis like the Ubuntu Wiki or Arch Wiki can be of help too. Look into your distribution's documentation as well.

Bash/Shell Resources

Here are some recommended links for learning shell scripting, some are Bash-specific:
By Craciun Dan on October 09, 2014 | Updated: October 09, 2014 r1
TuxArena Projects
Search
Online Readers