The relationship between permissions and commands of Linux Learning Notes (important) and summary of file and folder knowledge

Source: Internet
Author: User
Tags file copy

First, let the user access to a folder to become a working folder Basic permissions:

    • Commands that you can use: such as CDs and other commands that transform working folders.
    • Permissions required for folders: users must have at least x permission on this folder
    • Additional requirements: Assuming that the user wants to use the LS lookup file name in this folder, the user must also have R permission on the folder.

Second, the user in a folder to read a file's basic permissions:

    • Available commands: For example, the cat, more, less, etc. discussed in this chapter
    • Permissions required for the folder: the user must have at least X permission on this folder.
    • Permissions required for the file: The user must have at least R permission on the file .

Third, allow users to change the basic permissions of a file:

    • Commands to use: such as the Nano or VI editor.
    • Permissions required for the folder: the user must have at least X permission in the folder where the file resides;
    • Permissions required for the file: The user must have at least R, w permissions on the file

Iv. Basic permissions for a user to be able to create a file:

    • Permissions required for folders: users in this folder to have w,x permissions, focus on W.

The basic permissions for users to enter a folder and execute a command under that folder:

    • Permissions required for the folder: the user must have at least X permission on the folder;
    • Permissions required by the file: the user must have at least X permission on the file

File and folder management focus

1 absolute path: Must be by the root folder/write; relative path: not from/write

2 Special file folders are:.,... -, ~, ~account need attention;

3 folder-related commands are: CD, Mkdir,rmdir, PWD and other important commands;

4 rmdir can only delete empty folders. To delete a non-empty folder, you need to use the RM-R command;

5 The commands that the user can use are searched according to the folder specified in the PATH variable.

6 different identities (root and normal) the default PATH for the system is not the same. The big difference lies in/sbin,/usr/sbin.

7 LS is capable of viewing the properties of a file. Especially-D,-a,-l and other options are particularly important

8 file copy, delete, move can use: CP,RM, MV and other commands to operate.

9 Viewing the contents of a file (reading) commands that can be used include: Cat,tac, NL, more, less, head, tail, OD, etc.

Both Cat-n and NL can display line numbers, but the default is the case. Blank lines will not be numbered the same;

The purpose of one touch is to change the time parameters of the file, but also to create an empty file;

There are three different time periods for 121 file records. Each is access time (atime), Status Time (CTime), modification Time (mtime), and LS shows mtime by default.

13 In addition to the traditional rwx permissions, in the Ext2/ext3 file system, you can also use chattr and lsattr to configure and observe hidden properties. Common +a that contain only the new data and the +i attribute of the file can not be changed completely.

14 When creating new files/folders, the default permissions for new files are regulated using Umask.

The default folder has full permissions of drwxrwxrwx. The file is-rw-rw-rw-.

15 When a file has special permissions for suid, the user will temporarily have the permissions of the program owner when the user executes the binary program.

16 when a folder has special permissions for Sgid, the group of files created on behalf of the user under this folder will be the same as the group name of the folder.

17 when a folder has special permissions for Sbit, the file created by the user under that folder only has its own and root can be deleted

18 The type of observation file can be observed by using the files command;

19 The full file name of the search command can be which or type. both commands are searched through the path variable to find the file name;

20 The full file name of the search file can be searched using Whereis or locate to the database file without actually searching the filesystem.

21 use Find to add a lot of options to directly query the file system to get the name you want to know.

The relationship between permissions and commands of Linux Learning Notes (important) and summary of file and folder knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.