[kanchilug] 1D1C - compgen

  • From: Dhanasekar <tkdhanasekar@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx, kanchilug@xxxxxxxxxxxxx
  • Date: Tue, 31 May 2022 06:00:00 +0530

compgen -  is a bash built-in command which is used to list all the
commands that could be executed in the Linux system

To list all commands available to be directly executed.
$ compgen -c

To search for commands having a specific keyword
$ compgen -c | grep reminna

To count total number of commands available for use
$ compgen -c | wc -l

To list all the bash alias
$ compgen -a

To list all the bash built-ins
$ compgen -b

To list all the bash keywords
$ compgen -k

To list all the bash functions
$ compgen -A function



regards,
T.Dhanasekar

Other related posts: