0

I learned that there are external commands and internal commands

me@host:~$ time pwd
/home/gaowei

real    0m0.000s
user    0m0.000s
sys     0m0.000s
me@host:~$ /usr/bin/time pwd
/home/gaowei
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 2136maxresident)k
88inputs+0outputs (1major+86minor)pagefaults 0swaps

How could retrieve a list of all the internal commands. Are there distinction between internal commands and builtin commands?

The builtins could be retrieved by

me@host:~$ enable -a | cut -d ' ' -f 2 | nl
     1  .
     2  :
     3  [
     4  alias
     5  bg
     6  bind
     7  break
     8  builtin
     9  caller
    10  cd
    11  command
    12  compgen
    13  complete
    14  compopt
    15  continue
    16  declare
    17  dirs
    18  disown
Alice
  • 1,640
  • 3
  • 18
  • 36
  • 1
    There's a distinction between shell builtins and *keywords* - in fact the example you chose (`time`) is one of the latter - see for example the difference between `compgen -b` and `compgen -k` – steeldriver Mar 12 '19 at 01:08
  • 3
    Possible duplicate of [How do I list all available shell builtin commands?](https://askubuntu.com/questions/512918/how-do-i-list-all-available-shell-builtin-commands) – Olorin Mar 12 '19 at 06:49

0 Answers0