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

Screenshot 2022-09-04 at 7.48.01 PM.png You can even create your own commands.

sudo cp /usr/bin/ls /usr/bin/ls_new
new_ls
which new_ls

Screenshot 2022-09-04 at 7.48.19 PM.png

Difference between bin and sbin

  1. In bin folder user specific command are stored.
  2. In sbin folder root user commands are stored which can accessed by root user or by using sudo

see examples.

Screenshot 2022-09-03 at 7.22.38 PM.png