compgen is bash built-in command and it will show all available commands, aliases, and functions for you. The syntax is:
You can search or count the commands:
To list all the bash shell aliases available to you, enter:
compgen option
compgen command examples
To list all the commands available to you, enter:compgen -cSample outputs:
ls if then else elif fi .... mahjongg sol gtali sl-h gnobots2 gnotravex iagno fortune gnect gnome-sudoku LS glchess gnuchess gnuchessx
You can search or count the commands:
compgen -c | grep find compgen -c | wc -l echo "$USER user can run $(compgen -c | wc -l) commands on $HOSTNAME."Sample outputs:
vivek user can run 3436 commands on wks01.
To list all the bash shell aliases available to you, enter:
compgen -aSample outputs:
.. ... .... ..... .4 .5 bc cd.. chgrp chmod chown cp dnstop egrep ethtool fastping fgrep grep iftop l. ll ln ls mcdflush mcdshow mcdstats mount mv pscpu pscpu10 psmem psmem10 rm tcpdump update updatey vnstat wget which Other options are as follows:
######################################## # Task: show all the bash built-ins ######################################## compgen -b ######################################## # Task: show all the bash keywords ######################################## compgen -k ######################################## # Task: show all the bash functions ######################################## compgen -A function
No comments:
Post a Comment