Everything in Linux is file based. all the commands that we use in terminal is file based and are actually stored in a folder.
In Linux based file system /
is the starting folder and all the necessary information is stored in this folder only.
commands are stored in the /bin/
& /sbin/
folder.
To verify if every commands is stored in file run this command in terminal.
which ls
ls -la /usr/bin/ls
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662301139209/ywBuLQhKk.png" alt="ls command" width="90%"/>
You can even create your own commands.
sudo cp /usr/bin/ls /usr/bin/ls_new
new_ls
which new_ls
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662301147379/2K_E7_ert.png" alt="commands" width="90%" />
bin
and sbin
bin
folder user specific command are stored.sbin
folder root user commands are stored which can accessed by root user or by using sudo
see examples.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1662213774393/1uJySUtJ7.png" width="90%" alt="commands demo" />