linux command chmod 777 and drwxr-xr-x, respectively, what does it mean

With a recent operation and maintenance personnel learn something new, I did not feel how attention before, but now feel useful, especially to record it.

linux command lists use == ll == list when the front there is always a bunch of drwxr-xr-x, which has never been what does it mean to care about, just find your own directory and then finish up the meal operation. But this time how can not start the tomcat deployment project, and later got a look at the operation and maintenance personnel because there is no authority, he told me these are what that means, then I have myself looked at the statistics, organize here it is also easy for you to remember.

First of all, these letters are permissions mean

Calculated from the second permission letters start, a combination of three symbols, wherein - indicates no such permission, then acquire == drwxr-xr-x == explain briefly:

  • d: This bit indicates the file type. d is a directory file, l is linked files, - a regular file, p pipeline
  • rwx: The three (2-4) represents the permissions of the file owner has, r is read, w is written, x is executed. This indicates that the owner also has read, write, and execute permissions
  • rx: The three (5-7 digit) and represents the file owner where a group of the same user has permission. Represented here are read and execute permissions, no write permission
  • rx: The three (8-10) shows another user has permissions. Represented here are read and execute permissions, no write permission

Secondly, use ls -l (or ll) command on behalf of the meaning of each line of the list

  • Paragraph 1: File attribute field: the file attributes field a total of 10 letters, the first letter indicates the type of file, if the letter is a minus "-", it indicates that the file is a normal file. Letter "d" indicates that the file is a directory, the letter "d", is an abbreviation dirtectory (directory).
    Note that a directory or a folder is a special file, the file is stored in special information about other files and folders.
  • Paragraph 2: The file or directory hard links several subdirectories
  • Paragraph 3: file owner
  • Paragraph 4: the file belongs to the group of
  • Paragraph 5: File Size (in bytes)
  • Paragraph 6: file creation month
  • Paragraph 7: file creation date
  • Paragraph 8: file creation time
  • Paragraph 9: file name (if it is a symbolic link, then there will be a "->" arrow symbol behind it points to the root of a file)

The following comparison can take it:

drwxr-xr-x 1 62323 197609       0 4月  21 14:16 bin/
drwxr-xr-x 1 62323 197609       0 4月  21 14:16 cmd/
drwxr-xr-x 1 62323 197609       0 4月  21 14:16 dev/
drwxr-xr-x 1 62323 197609       0 4月  21 14:16 etc/
-rwxr-xr-x 1 62323 197609  149784 2月  26 19:48 git-bash.exe*

The final step is the meaning of digital empowerment

Use chmod empowerment, we usually write:

chmod 777 test.txt

So the meaning above 777 represented like this:

  • r: read permission for a read - numeral 4
  • w: write express written permission - number 2
  • x: excute that the implementation of rights - the number 1 indicates
  1. The first 7: Indicates == == belongs to the main permission has 4 + 2 + 1 == == == There also is simultaneously read, write, and execute permissions ==
  2. The second 7: indicates the owner == == same for all users of a group has 4 + 2 + 1 == == permissions
  3. The third 7: Indicates == == Other users have permission 4 + 2 + 1 == =='s

So here you can see the 777 has the power (empowerment must be careful!)

Another example: rwxrwxr-- 774
means the file (folder) the same group of owners and users to read and write and execute permissions, other users only read access to the group. That is three listed an owner permissions, the middle three represent the same set of user rights, the last group represents the rights of other users (not including root).

For the last Detailed case:

    drwxr-xr-x 1 62323 197609       0   4月  21 14:16  bin/

among them:

  • d: is the directory represents == bin ==
  • rwx: 62,323 indicates == == genus have primary authority is readable == (r), write (w) and executable (X) ==
  • rx (5-7 bits): represents the owner == == 62323 in the same group (== == 197 609) the user's privileges are readable == (r) and executable (X) ==
  • rx (8-10 bits): indicates that another user has permission to read == (r) and executable (X) ==
  • 1: The number of hard links files or subdirectories number 1
  • 62323: Indicates a user to my laptop (before some of my qq number)
  • 197609: 62323 == == represents the group the user belongs to the group
  • 0: indicates the file size is 0 bytes == ==
  • April: that is to create the month of April == ==
  • 21: Creating a date == 21 ==
  • 14:16: time of creation of the afternoon == 14:16 ==
  • bin /: file name represented here refers to the directory name

Guess you like

Origin www.cnblogs.com/hanxiaochuang666/p/11113602.html