Linux Format

The power of permission­s

-

Each file in Linux has a set of user and group permission­s, and you can use ls -l to see a file’s full set of permission­s and attributes. The output begins with the permission flags like this drwxr-xr-x that has four components: $ ls -l -rwxrw-r-- 1 bodhi bodhi 23339 Dec 13 08:47 some-document.pdf drwxr-xr-x 3 bodhi bodhi 4096 Feb 4 12:32 Desktop

The first character indicates whether the correspond­ing item is a directory or a file with a directory marked with a d character and a regular file marked with a hyphen ( - ). The next nine characters are broken up into sets of three characters each, which indicate permission­s for the user, group and everyone else respective­ly. The r denotes read permission, w is for write permission­s and x points to execute permission­s. The first entry in the example reads rwxrw-r-- , which means the user has read, write and execute permission­s, while other members of the group have read and write permission­s and everyone else can only read the file.

Sometimes the permission­s are represente­d with a numerical notation. Read permission­s weigh in at 4, write is 2 and execute is 1. So the permission rwxr-x--x can be presented as (4+2+1)(4+0+1)(0+0+1) or 751.

Newspapers in English

Newspapers from Australia