Inspect binaries in /usr/bin
In this step, we will explore a very important directory in the Linux file system: /usr/bin
. This directory contains many of the executable programs (binaries) that you use regularly from the command line.
Think of /usr/bin
as a central location for user-level commands. When you type a command like ls
, cd
, or echo
, the system looks for the corresponding executable file in directories listed in your system's PATH environment variable, and /usr/bin
is typically included in that path.
We will use the ls
command to list the contents of the /usr/bin
directory. The ls
command is used to list files and directories.
Open your terminal if it's not already open.
Type the following command and press Enter:
ls /usr/bin
You will see a long list of file names. These are the executable programs located in /usr/bin
.
[... many file names ...]
zsh
zsh-beta
zsh-common
zsh-dbg
zsh-static
zsh5
zsh5.8
[... many more file names ...]
This list shows you just how many commands are available on your system! You might recognize some names from previous steps, like echo
, whoami
, and id
.
To see a more detailed list, including file permissions, ownership, and size, you can use the -l
flag with ls
:
ls -l /usr/bin
This output will be much more detailed:
total 251128
-rwxr-xr-x 1 root root 35840 Mar 15 2022 [
-rwxr-xr-x 1 root root 27520 Mar 15 2022 [[
-rwxr-xr-x 1 root root 27520 Mar 15 2022 test
-rwxr-xr-x 1 root root 11000 Mar 15 2022 aarch64-linux-gnu-addr2line
-rwxr-xr-x 1 root root 11000 Mar 15 2022 aarch64-linux-gnu-ar
[... many more lines ...]
Don't worry about understanding all the details in the -l
output right now. The main goal is to see the sheer number of commands available in /usr/bin
and understand that this is where many common Linux commands reside.
You can also try listing the contents of other directories, like /bin
, which also contains essential system binaries.
Click Continue to finish this lab.