CentOS file system partition basics

Source: Internet
Author: User
A file system is a structure and algorithm used to manage devices and organize files. /Boot partition, which contains the kernel of the operating system and the files to be used during system startup. it is necessary to create this partition, because most PCs are subject to BIOS restrictions, moreover, if you have a separate/boot partition, the computer can still start even if the primary root partition has a problem. /Usr partition, which is RedHatli

A file system is a structure and algorithm used to manage devices and organize files.

/Boot partition, which contains the kernel of the operating system and the files used during system startup.
Zone is necessary, because most PCs are currently subject to BIOS restrictions, and if there is a separate/boot
Dynamic partition, even if the main root partition has a problem, the computer can still start.

/Usr Partition: The place where the software is stored in Red Hat linux. if possible, allocate the maximum space to it.
/Home partition is the location of your home directory. The size of this partition depends on the number of users. If there are multiple
If you use a computer together, this partition is completely necessary, and the root user can control the common
Users use computers, such as implementing limited disk usage for users or user groups, and restricting normal users to access files.
In fact, it is also necessary for a single user to establish this partition, because without this partition, you can only log on as the root user.
This is dangerous because the root user has the absolute right to use the system. However, if you mistakenly operate the system
As well as the trouble.
/Var/log partition is the system log record partition. if this independent partition is set up, even if the system
Log files are faulty, and they do not affect the primary partition of the operating system.
/Tmp partition, used to store temporary files. This is necessary for multi-user systems or network servers. This
Even if a large number of temporary files are generated during the program running, or the user has performed an incorrect operation on the system
It is still safe. Because this part of the file system is still subject to read/write operations
Its parts cause problems faster.
/Bin partition, which stores standard system utilities.
/Dev partition to store device files.
/Opt partition, which stores optional installed software.
/Sbin partition, which stores Standard System Management files.

Every time we install the system, we will partition. The relationship between disk partitions and directories in Linux is as follows:

-Any partition must be mounted to a directory.

-Directories are logically differentiated. Partitions are physically differentiated.

-All Linux partitions on a disk must be mounted to a specific directory in the directory tree for read and write operations.

-The root directory is where all Linux files and directories are located. you need to mount a disk partition.

All disk partitions must be attached before they can be used. how is the hard disk partition on our machine mounted?

A: This is mainly because it uses the/etc/fstab file. Each time the kernel loads it, the file system is mounted from here. Each time the system starts, it is automatically mounted according to the file definition. Partitions cannot be used if they are not automatically mounted.

A drive module of a mobile hard disk is automatically mounted. if a new hard disk exists, you must first partition it and mount it to a folder by running the mount command. To automatically mount the file, you can modify the/etc/fstab file.

 

View file content

Cat:
Cat [file]
View the file content. The full-process concatenate means that the file content is continuously output to the screen. The first and last rows are displayed.
Tac:
Tac [file]
The opposite of cat is that it is viewed from the last row to the first row.

When cat has a bad place, it cannot be clearly viewed when the file is large. in this case, you can use the more or Less command.

More:
More [file]
If you use commands such as grep or find, you can view them one page at a time. If half of them want to exit, press 'Q' to exit.
Less:
Less [file]
Less is more flexible than more and can be used to flip pages.

If you only want to read the first few lines of the file or the last few lines of the file, you can use head or tail.
Head-n [file]: the first n rows of the file.
Tail-n [file]: reads n rows at the end of the file.

File Search

Which:
Which [filename]
This command is used to query the executable files in the PATH through the PATH.
For example: Which passwd: Find the executable file passwd
Whereis:
Whereis [-bmsu] [keyword]
This command is used to list the files and directories of related words. (Linux records all files in a file database. This command is used to query files from the database. Therefore, the database is updated every day)

Locate:
Locate [filename]
This command is used to list the files and directories of related words. Searching for data is extremely fast, and it is also queried through the database. However, the database is updated once a week, so some data may not be found. You can modify the configuration file.

Find:
Find [path] [parameter] [keyword]
This command is used to search for files in a specified path. Because data is not queried, the query speed is slow.

Looking for a job working at Home about MSBI

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.