Linux commands storage
Linux commands file system
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
You can even create your own commands.
sudo cp /usr/bin/ls /usr/bin/ls_new
new_ls
which new_ls
Difference between bin
and sbin
- In
bin
folder user specific command are stored. - In
sbin
folder root user commands are stored which can accessed by root user or by usingsudo
see examples.