Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The second basic part of Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Special permissions

SUID: 2 when a user executes this binary program, the user will temporarily have owner privileges during execution

* valid for binary programs only

* the executor must have x permission for the program

* this permission is valid only during execution

* the executor will have the owner permission to change the program

SetUID: when the file owner's x permission becomes s, it is called SetUID.

SGID: 4 all file groups created by users in this directory will have the same name as the user group in this directory.

* SGID is valid for binary programs, but we use it more in directories

* the executor of the program must have x permission to change the program.

* the executor will be supported by this user group during execution

* the valid user groups in this directory will be the same as this directory

SBIT: 1 only the user and the root user can delete the files created by the user in this directory

Query of documents

1. Query which for script files

* this command queries the file name of the executable file according to the path of the PATH specification. Different users may find different results.

* the built-in commands of bash cannot be queried with which. You can use type to query

two。 Query whereis for file names

-b (binaries)-s (find source files only)-m (find description files only)-u (find files that are not the three mentioned above)

* * whereis is faster than find because find searches the hard disk directly, while whereis and the locate below are database files that find system records.

Sometimes you will find that you can find deleted files with whereis and locate, which is related to the database files of the system.

3. Incomplete file name query locate

* * since you are looking for files in the database, you can update the database before each search, otherwise you may not be able to find the newly created files

Update the database and use updatedb!

4. Powerful query command find

a. Time parameter

-mtime: 1.n n days ago, the day was modified.

2. n days ago that was modified.

3.-n has been modified in n days

* * the system displays mtime by default

-ctime:access time

-atime: status time

b. User and user group parameters

-uid n-gid n-user name

-group name-nouser-nogroup

c. File name, permissions, type

-name-size [+ / -] SIZE-type TYPE-perm [+ /-/] mode

d. Other parameters

-exec command will use command to process the results found

-print prints the results to the screen (default option)

File system operation of Linux

Because all the data has to be loaded into memory before CPU can process it, if you often have to edit a large file and write it to disk frequently, if your hard disk has been in service for a long time, the process is really slow. Linux has made such efforts to improve efficiency:

Using asynchronous processing to solve efficiency problems

Files set to Dirty are written back to disk from time to time by the system to maintain the consistency of disk files and memory data. But it is not before you modify it, it is written back directly.

But we can use sync to force the modified files to be written back to disk to ensure that our files are saved on disk, usually before shutting down.

* the system will put the commonly used file data into the buffer of main memory to speed up the reading and writing of the file system

* during a normal shutdown, the shutdown command will actively call sync

* abnormal shutdown and non-use of sync will cause file data not to be written back in time, and disk verification will be performed at boot time, which may also lead to file system corruption (non-disk corruption).

Mounting point

Mount: the operation of combining a file system with a directory tree

* * the mount point must be a directory, that is, the directory is the entry into the file system. So the file system must be mounted in a directory of the directory tree before it can be used

Other file systems supported by Linux

The standard file system for Linux is ext2

Traditional file system: ext2 minix MS-DOS FAT iso9660

Journaling file system: ext3 ReiserFS Windows'NTFS IBM'sJFS SGI'sXFS

Network file system: NFS SMBFS

VFS: the virtual file system is used to read the file system and automatically helps us identify and manage the file system.

Capacity of disks and directories

1.df: lists the overall disk usage of the file system

The common option-h is displayed in GB,MB,KB-I using inode capacity instead of hard disk capacity

* / dev/shm is the disk space virtualized by easy-to-use memory, and the access speed is very fast, but the files created in it are lost when the computer is turned off.

2.du: evaluate the disk usage of a file system

The common option-s lists only the total capacity, not the capacity occupied by each directory

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report