You are not getting any files against those commands because they are shell (bash
) built-ins, not separate executable files (e.g. binary files, scripts). Actually, shell built-ins are compiled into the shell executable; if you want you can check the source code to be sure of it. As which
or whereis
only looks for external executable files, you are not getting any output for the built-ins.
To find if a command is a built-in or alias or function or external file, the best way is to use the type
built-in:
$ type fg
fg is a shell builtin
$ type bg
bg is a shell builtin
$ type jobs
jobs is a shell builtin
Also note that your find
command is not syntactically correct. The correct (simplest) syntax is find /where/to/search -name 'name_to_search'
.
Also note that few commands are implemented as both a shell built-in and a separate standalone executable. For such commands, always remember that the built-in command will take precedence over the external one. So, when you run echo something
, the built-in echo
is run. If you want to run the binary executable echo
you need to call it in a different way. One way is to use the full path to the executable: /bin/echo something
.
To display all available versions of a command, run type
with the -a
option:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
To get documentation for shell built-ins, you can check the man
page of bash
or use the help
command (which is a built-in command):
help jobs
Also as @terdon pointed out you should use type
instead of which
.
bash
. Do aman bash | grep fg
;) (see steeldrivers' answer)