trap

 

Get help on Linux trap Command.

 

   Linux trap command is use to trap signals and other events on Linux system.  The Linux trap command is one of bash shell built in command.  The command example below show how to get trap command manual or help on Linux trap command using shell command, this help show information on how to use the Linux trap command, the trap command options and the arguments that can be use with Linux trap command.

 

Get Linux trap command help

 

  Execute help command and the name of Linux command that we want the help file, the example below we execute help command with -m option to get the help for trap command using the manpage format.

trap linux command

[linux@fedora11 ~]$ help -m trap

NAME

    trap - Trap signals and other events.

 

SYNOPSIS

    trap [-lp] [[arg] signal_spec ...]

 

DESCRIPTION

    Trap signals and other events.

 

    Defines and activates handlers to be run when the shell receives signals

    or other conditions.

 

    ARG is a command to be read and executed when the shell receives the

    signal(s) SIGNAL_SPEC.  If ARG is absent (and a single SIGNAL_SPEC

    is supplied) or `-', each specified signal is reset to its original

    value.  If ARG is the null string each SIGNAL_SPEC is ignored by the

    shell and by the commands it invokes.

 

    If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell.  If

    a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command.