Ubuntu Tutorial

Listing Commands : compgen is bash built-in command and it will show all available commands, aliases, and functions.

syntax : compgen options

Options Description
-a list all the available aliases.
-b list all the built-ins you could run.
-c list all the available commands.
-k list all the available keywords.
-A function will list all the available bash functions.

we can use multiple options for command.

  • compgen -ac
  • this will list all the available aliases and commands

    Pager : pager is utility that is used by the commands like less, man, info. it display output on special screen. to navigate through the output use following instructions

    • use Arrow Keys to move up, down, left and right
    • use Space Bar to display next page
    • press b or B to display backward page
    • use Home button to go on first page
    • use End button to go on last page
    • press q to quit the pager program

    Command Description : Long list of commands found in Ubuntu system. Remembering command with it's functionality is too hard thing for any user. sometime you may need to access documentation about command. instead of going online to check for command documentation, use following command to check documentation offline.

    man command : man is system program or command. it store the descriptions in the system document. it uses pager to display the output. man documentation is helpful when you know which utility you want to use but have forgotten exactly how to use it. You can also get information about specific topics or check which features are available. it gives information in topics like Name, Synopsis, Description, Author ,Reporting Bugs,Copyrights etc Man pages are stored in places like /usr/share/man and /usr/local/share/man

    syntax : man command/utility

    man command

    info command : info is system program or command. it store the descriptions in the system document. it uses pager to display the output. info document gives more detailed information than man command. it may gives example and output of that example also. it try to explain all the ways to use command or utility due to that many times documentation gets too longer for user.

    syntax : info command/utility

    info command

    --help or -h : this is program utility. it will display output on terminal. it depend on command that it support --help or -h or both

    -h option

    apropos command : if you don’t remember command but know some specific keywords related to command. Then apropos command is helpful for you.

    apropos command searches given keyword and match that with short description of all commands in man pages. If match found it return the command with matched line.

    syntax : apropos keyword

    apropos command

    whatis command : whatis command display description of command in one line. we can pass multiple commands to it.

    syntax : whatis commands-name

    In following example we pass apropos and head commands to whatis command.

    whatis command