Issue
I am trying to figure out the different components of Linux and how they work together, and I have a terminology related question. The terminal runs the shell, which is usually Bash. Does that mean that Linux commands (e.g. ls, mkdir, copy) are part of Bash (or the shell in general)?
Solution
No, commands such as ls
, mkdir
, cp
(POSIX does not define a command named
copy
) are not implemented by Bash. They are external commands as you
can learn with type
:
$ type -a ls
ls is aliased to `ls --color=auto'
ls is /usr/bin/ls
ls is /bin/ls
$ type -a mkdir
mkdir is /usr/bin/mkdir
mkdir is /bin/mkdir
$ type -a cp
cp is /usr/bin/cp
cp is /bin/cp
On desktops GNU based Linux distros such as Debian or Slackware they are implemented by GNU coreutils package. On embedded systems Busybox or Toybox are commonly used instead of GNU coreutils for its smaller size and memory footprint (and Bash is usually not used on such systems).
That being said, there are some commands which are implemented within
Bash for example pwd
or cd
:
$ type pwd
pwd is a shell builtin
$ type cd
cd is a shell builtin
Answered By - Arkadiusz Drabczyk