Default permissions, Displaying file and directory permissions (ls), File and directory permission fields – HP NonStop G-Series User Manual

Page 123: Figure 8

Advertising
background image

Figure 8 File and Directory Permission Fields

Default Permissions

When you create a file or directory, the system automatically supplies a predetermined permission
code. A typical file permission code is:

-rw-r--r--

This file permission code specifies that the owner has read and write permissions but not execute
permission, while the group and all others have read permission but not write or execute permission.

A typical directory permission code is:

drwxr-xr-x

This directory permission code specifies that the owner has read, write, and execute permissions,
while the group and all others have read and execute permissions but not write permission.

The default permission codes that your system provides relieve you from the task of specifying them
explicitly every time you create a file or directory. If you wish to create your own default permission
codes, you must change your user mask with the umask command. For an explanation of umask,
see

“Setting the User Mask” (page 128)

.

Displaying File and Directory Permissions (ls)

To display the current file permissions for all files and directories in your current directory, enter
the ls command with the -l flag. To display the permissions for a single file or selected files,
enter the following format:

ls -l filename

The filename entry can be the name of the file or a list of filenames separated by spaces. You
can also use pattern-matching characters to specify files.

To display the permissions for all the files in your current directory, enter the ls -l command,
as shown in the following example:

$ ls -l

total 21

-rw-r--r-- 1 larry system 101 Jun 5 10:03 file1

-rw-r--r-- 1 larry system 171 Jun 5 10:03 file2

-rw-r--r-- 1 larry system 130 Jun 5 10:06 file3

drwxr-xr-x 2 larry system 32 Jun 5 10:07 project

Displaying File and Directory Permissions (ls)

123

Advertising
This manual is related to the following products: