[kanchilug] 1D1C - compgen

  • From: Dhana Sekar <tkdhanasekar@xxxxxxxxx>
  • To: ILUG-C <ilugc@xxxxxxxxxxxxx>, kanchilug@xxxxxxxxxxxxx
  • Date: Mon, 24 Jun 2013 17:29:55 +0530

command: compgen
purpose: it is a built-in command and it will show all available commands,
              aliases and functions in our systems
syntax: compgen [option]

example:

1. To list all available commands in your system
    $compgen -c
2. To count the commands available in the system
    $compgen -c | wc -l
3. To list the available aliases
    $compgen -a
4. To show all the bash built-in commands
    $compgen -b
5. To show all the bash keywords
    $compgen -k
6.  To show available functions
    $compgen -A

regards,
dhanasekar

Other related posts: