O'Reilly logo

Linux Shell Scripting Essentials by Sinny Kumari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Permission and ownership

As a user of a system, to access a file in Linux and UNIX, it is important that a user has the required permission for that specific file or directory. For example, as a regular user, perform cd into /root:

$ cd /root
bash: cd: /root/: Permission denied

We were not able to do so because of the permission denied error:

$ cd ~/

We were successfully able to do cd into the user's home directory because a user had the permission to access its own home directory.

Every file in UNIX or Linux has an owner and an associated group. It also has a set of permissions (read, write, and execute) with respect to the user, group, and others.

Viewing the ownership and permission of files

The ls command with the -l option is used to view the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required