The ‘ls‘ command can be used to show us what files and directories exist in the ‘/root‘ directory.
However, because these files and directories belong to the admin user (root) we can’t just take a peek at them as a regular user for security reasons.
As you can see from the screenshot above, I get the “Permission denied” output on the terminal.
For us to see the files and directories that exist in the ‘/root‘ directory we need to use the ‘sudo‘ command.
Not only that, but the user also needs to have privileges to carry out this command.
When we first install linux we will usually create a new user. This user will have the sudo privileges needed.
The following screenshot shows the files and directories that exist in my ‘/root‘ directory by using the sudo command as a regular user named ‘anonymous’.
This ‘anonymous’ user has admin privileges: