For example, typing compgen -u
on an Ubuntu box returns a list of users. This includes more users than are listed in /etc/passwd
. So the question is when using bash completion to list out users, where does the list come from?
You can run strace -o compgen.out bash -c 'compgen -u'
and then look at the compgen.out
file to try to find out what it is using.
On my machine that file ends with an open("/etc/passwd", O_RDONLY)
followed by the writing of the output.