Embedded Linux basics (file and file system)

1. Overview of Linux Development

  • Linux refers to a set of UNIX-like operating systems that are free to use and spread freely.
  • GNU is to promote the spirit of free software to realize a free operating system, and then start from the application to realize its kernel.
  • The program development in it complies with the General Public License (GPL) agreement, which stipulates that the source code must be freely available and modified.
  • Strictly speaking, Linux should be called GNU/Linux, and many important tools such as gcc, gdb, make, emacs, etc. are contributed by GNU.

Linux kernel version number: The
format of the Linux kernel version number is xyzz-www. The number x represents the version type. When the number y is an even number, it is a stable version, and when it is an odd number, it is a development version. For example, 2.0.40 is the stable version and 2.3.41 is The development version, the test version is 3 numbers plus the test number, such as 2.4.12-rc1. The latest Linux kernel version can be obtained from http://www.kernel.org.

Two, linux advantage

1. Low-cost development system
2. Can be applied to a variety of hardware platforms
3. Customizable kernel
4. Excellent performance
5. Good network support

Linux currently has more than 250 distributions.

Three, basic concepts

1. File system

  1. Everything in linux is a file.
  2. File system refers to the software and data related to file management in the operating system.

The difference between linux file system and windows file system:

  • The Windows file system is based on the drive letter, and each directory corresponds to the corresponding partition. For example, "E:\workplace" means that the file is in the E drive partition. Linux is just the opposite. The file system is a file tree, and all its files and external devices (such as hard drives, optical drives, etc.) are hung on this file tree in the form of files, such as "/usr/local".
  • For Windows, it means that all partitions are in some directories. In short, under Windows, the directory structure belongs to the partition; under Linux, the partition belongs to the directory structure.

2. Mount

  1. The process of mapping partitions and directories is called mounting .
  2. The location of this mount in the file tree is the mount point .

3. Primary partition, extended partition and logical partition

  1. The primary partition is the hard disk partition that contains the files and data necessary for operating system startup. To install the operating system on the hard disk, the hard disk must have a primary partition, and the number of primary partitions can be 1 to 3;
  2. An extended partition is a partition other than the primary partition, but it cannot be used directly. It must be divided into several logical partitions before it can be used. The number can be 0 or 1;
  3. The logical partition is no limit on the number.

Four, Linux file and file system

1. File type

There are four main file types in Linux:
ordinary files, directory files, link files and device files.

2. File attributes

Insert picture description here

  • 3 different access rights:

Readable (r), writable (w) and executable (x).

  • The file has 3 different user levels:

The file owner (u), the user group it belongs to (g), and other users in the system (o).
Insert picture description here

3. File system type

  • ext2 and ext3 (Linux default file system)
  • swap file system
  • vfat file system
  • NFS file system
  • ISO9660 file system

4. Linux directory structure

  • /bin directory where the executable file is located

  • /media mount device media, u disk, CD-ROM, etc.

  • /mnt allows users to mount other file systems

  • /usr is a huge and complex directory, many applications will be installed in this directory

  • /usr/local The directory where the user installs the software

  • /sbin executable file directory of super administrator root

  • /proc system memory mapping, will retain some information about the process running

  • /etc system software startup and configuration directory

  • /etc/passwd User storage file man 5 passwd View file format

  • /etc/shadow stores password files

  • /dev directory where the device file is located

  • /boot This directory stores the programs used when the operating system starts

  • /lib store system dynamic link shared library

  • /root Home directory when the super user logs in

  • /tmp stores temporary files generated during the execution of different programs

  • /usr/src The default storage directory of the kernel source code

  • /srv stores some data that needs to be extracted after the service is started

  • /var Log information of many services is stored in this file

  • /home/user user home directory

Five, summary

This study mainly learned about the development, advantages, and versions of Linux, and focused on learning Linux files and file systems, the difference between Linux file systems and Windows file systems, and the concept of partitions. It involves a lot of little knowledge, such as mounting and mounting points, file classification, permissions, attributes, etc. I hope to work harder in the future study and life!

Guess you like

Origin blog.csdn.net/weixin_44366125/article/details/105956352