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

What's the use of Linux system?

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces the use of the Linux system, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The directory tree can be divided into small parts, each of which can be on its own disk or partition. The main parts are the root, / usr, / var, and / home file systems. Each part has a different purpose. Every machine has a root file system, which contains the files necessary for the system to boot and enable other file systems to mount, and the root file system should have enough content necessary for a single-user state. It should also include tools to repair damaged systems, restore backups, and so on.

The / usr file system contains all commands, libraries, man pages, and other unchanged files required for general operations.

/ usr should not have files to be modified in general use. This allows files in this file system to be shared over the network, which is more efficient because it saves disk space (/ usr can easily be hundreds of megabytes) and is easy to manage (when upgrading an application, only the master / usr needs to be changed, not each machine), even if the file system is on a local disk, it can be read-only mount to reduce file system corruption when the system crashes.

The / var file system contains files that can be changed, such as spool directories (for mail, news, printers, etc.), log files, formatted manual pages, and temporary files. Traditionally, everything in / var was somewhere under / usr, but this makes it impossible to install / usr only.

The / home file system contains the user's home directory, that is, all the actual data on the system. A large / home may be divided into several file systems, and you need to add a name under / home, such as / home/students, / home/staff, and so on.

/ Etc file system

The / etc directory contains various system configuration files, some of which are described below. The rest of you should know which program they belong to and read the man page of the program. Many network configuration files are also in / etc.

1. / etc/rc or / etc/rc.d or / etc/rc?.d: the directory of scripts or scripts that start or change the runtime line.

2. / etc/passwd: user database in which the domain gives the user name, real name, user initial directory, encrypted password, and other user information.

3. / etc/fdprm: floppy disk parameter table, which is used to describe different floppy disk formats. Setfdprm feed settings are available. For more information, see the setfdprm help page.

4. / etc/fstab: specify a list of file systems that need to be automatically mounted at startup. Information about the swap zone enabled with swapon-an is also included.

5. / etc/group: similar to / etc/passwd, but not user information but group information. Including all kinds of data for the group.

6. Configuration file for / etc/inittab:init.

7. / etc/issue: includes the user's output information before the login prompt. It usually includes a short description or welcome message of the system. The specific content is determined by the system administrator.

8. / etc/magic: configuration file for "file". Contains descriptions of different file formats, based on which "file" guesses the file type.

9. / etc/motd:motd is the abbreviation of message of the day, which is automatically output after the user successfully logs in. The content is determined by the system administrator.

It is often used to announce information, such as a warning of a planned shutdown time.

10. / etc/mtab: list of currently installed file systems. Initialized by the script (scritp) and automatically updated by the mount command. Use when you need a list of currently installed file systems (for example, the df command).

11. / etc/shadow: the shadow password file on the system where the shadow password software is installed. The shadow password file moves the encrypted password from the / etc/passwd file to / etc/shadow, which is readable only to the superuser (root). This makes it more difficult to decipher passwords, thus increasing the security of the system.

12. Configuration file for the / etc/login.defs:login command.

13 / etc/printcap: similar to / etc/termcap, but for printers. The grammar is different.

14, / etc/profile, / etc/csh.login, / etc/csh.cshrc: files executed by bourne or c shells when logging in or starting. This allows the system administrator to establish a global default environment for all users.

15. / etc/securetty: confirm the secure terminal, that is, which terminal allows superuser (root) login. Generally only virtual consoles are listed, so it is not possible (at least difficult) to break into the system through a modem (modem) or network and get super user privileges.

16. / etc/shells: lists the shell that can be used. The chsh command allows the user to change the login shell within the scope specified in this file. Provide one

The server process ftpd of the machine ftp service checks whether the user shell is listed in the / etc/shells file, and if not, the user will not be allowed to log in.

17. / etc/termcap: terminal performance database. Explain what "escape sequence" control is used by different terminals. Do not directly output escape when writing a program

Sequence (which only works on terminals of a specific brand), but instead looks for the correct sequence of work to be done from / etc/termcap. In this way, most programs can run on most terminals.

/ Dev file system

The / dev directory includes device files for all devices. The device file is named with a specific convention, which is described in the device list. The equipment files are generated by the system during installation and can be described later with / dev/makedev. / dev/makedev.local is a description written by the system administrator for local device files (or connections) (for example, some non-standard device drivers are not part of the standard makedev). Here is a brief introduction to some common files under / dev.

1. / dev/console: the system console, that is, the monitor that connects directly to the system.

2. / dev/hd:ide hard disk driver interface. For example, / dev/hda refers to the first hard disk, and had1 refers to the first partition of / dev/hda. If there are other hard drives in the system, then / dev/ hdb, / dev/hdc, … ... If there are multiple partitions, they are hda1, hda2... ...

/ dev/sd:scsi disk driver interface. If the system has a scsi hard drive, it will not access / dev/had, but will access / dev/sda.

4. / dev/fd: floppy drive device driver. For example, / dev/fd0 refers to the first floppy disk of the system, which is commonly referred to as disk a, and / dev/fd1 refers to the second floppy disk. ... The / dev/fd1 H2440 indicates access to the 4.5 high-density disk in drive 1.

5. / dev/st:scsi tape driver.

6. / dev/tty: provide virtual console support. For example, / dev/tty1 refers to the first virtual console of the system, and / dev/tty2 refers to the system

The second virtual console of the

7. / dev/pty: provide pseudo terminal support for remote login. The / dev/pty setting is used when logging in to telnet.

8. / dev/ttys: computer serial interface, which is the "com1" port for dos.

9. / dev/cua: computer serial interface, a device used with a modem.

10. / dev/null: "black hole", all information written to the device will disappear. For example, when you want to hide the output information on the screen

Simply input the output information into / dev/null.

/ Usr file system

/ usr is a very important directory, and the file system is usually large because all programs are installed here. All files in / usr are generally from linux distributions; locally installed programs and other things are under / usr/local, because you don't have to reinstall all programs when upgrading a new version or release. Many of the contents in the / usr directory are optional, but these features will make users use the system more efficiently. / usr can accommodate many large software packages and their configuration files. Some important directories are listed below (some less important ones are omitted).

1. / usr/x11r6: contains all executable programs, configuration files, and support files for x window systems. To simplify the development and installation of x, the files of x are not integrated into the system. X window system is a powerful graphics environment, which provides a large number of graphics tools and programs. If users are familiar with microsoft windows, they will not be at a loss about the x window system.

2. / usr/x386: similar to / usr/x11r6, but for x11 release 5.

3. / usr/bin: it centralizes almost all the user commands and is the software library of the system. Other commands are in / bin or / usr/local/bin.

4. / usr/sbin: includes unnecessary system management commands for the root file system, such as most service programs.

5. / usr/man, / usr/info, / usr/doc: these directories contain all the man pages, gnu information documents, and various other documentation files. Each section of the online manual has two subdirectories. For example: / usr/man/man1 contains the source code for the first section of the online manual (there is no formatted original file), and / usr/man/cat1 contains the formatted content of the first section. The online manual is divided into the following nine sections: internal commands, system calls, library functions, devices, file formats, games, macro packages, system management, and core programs.

6. / usr/include: contains c language header files, most of which end with .h, which are used to describe the data structures used in c language programs.

Subprocesses and constants. For consistency, this should actually be placed under / usr/lib, but the name has been used all the time.

/ usr/lib: contains immutable data files for programs or subsystems, including some site-wide configuration files. The name lib comes from the library (library); the original library for programming also exists in / usr/lib. When the program is compiled, the program connects to the libraries in it. There are also many programs that store configuration files.

8. / usr/local: locally installed software and other files are placed here. This is very similar to / usr. Users may find some larger software packages here, such as tex, emacs, and so on.

/ Var file system

/ var contains data to be changed when the system is generally running. Usually, the size of the directory in which the data is located is often changed or expanded. It turns out that some of the contents of the / var directory are in / usr, but in order to keep the / usr directory relatively stable, put those directories that need to be changed frequently into / var. Each system is specific, that is, it is not shared with other computers over the network. Some important directories are listed below (some less important ones are omitted).

1. / var/catman: includes formatted man pages. The source files for help pages generally exist in / usr/man/catman; some man pages may have preformatted versions and exist in / usr/man/cat. Other man pages need to be formatted when they are viewed for the first time, and the formatted version exists in / var/man so that others don't have to wait for formatting when they look at the same page. / var/catman is often cleared, just like clearing a temporary directory.)

2. / var/lib: store the files to be changed when the system is running normally.

3. / var/local: stores variable data of the program installed in / usr/local (that is, the program installed by the system administrator). Pay attention, if necessary

Even locally installed programs use other / var directories, such as / var/lock.

4. / var/lock: lock the file. Many programs follow the convention of generating a locked file in / var/lock to support their ongoing

Use a specific device or file. When other programs notice the locked file, they will no longer use the device or file.

5. / var/log: log files of various programs, especially login (/ var/log/wtmplog records all logins and logouts to the system) and syslog (/ var/log/messages records stores all core and system program information). Files in / var/log often grow indefinitely and should be cleared on a regular basis.

6. / var/run: an information file about the system that is valid before the next system boot. For example, the / var/run/utmp package contains information about the user who is currently logged in.

7. / var/spool: places directories for spool programs, such as mail, news, print queues, and other queues to work. Every

Each different spool has its own subdirectory under / var/spool, for example, the user's mailbox is stored in / var/spool/mail.

8. / var/tmp: temporary files that are larger or require longer periods of time are allowed than / tmp. Note that the system administrator may not allow / var/tmp to have very old files.

/ Proc file system

The / proc file system is a pseudo file system, which means that it is a directory that does not actually exist, so it is an unusual directory. It does not exist on a disk, but is generated by the core in memory. This directory is used to provide information about the system. Some of the most important files and directories are described below (the / proc file system is described in more detail on the proc man page).

1. / proc/x: the directory of information about process x, which is the identification number of this process. Each process has a directory under / proc called its own process number.

2. / proc/cpuinfo: stores information about the processor (cpu), such as the type, manufacturer, model and performance of the cpu.

3. / proc/devices: a list of device drivers that are currently running core configurations.

4. / proc/dma: displays the currently used dma channel.

5. / proc/filesystems: file system information of the core configuration.

6. / proc/interrupts: displays the interrupt information and occupant information, as well as the number of occupants.

7. / proc/ioports: the iUnix port currently in use.

8. / proc/kcore: system physical memory image. It's exactly the same size as physical memory, but it doesn't actually take up so much memory; it's just

It is created only when the program accesses it. (note: unless you copy it somewhere, nothing under / proc takes up any disk space.)

9. / proc/kmsg: the message output by the core. Will also be sent to syslog.

10. / proc/ksyms: core symbol table.

11. / proc/loadavg: system "average load"; three meaningless indicators indicate the current workload of the system.

12. / proc/meminfo: various memory usage information, including physical memory and swap partition (swap).

13. / proc/modules: stores the information of which core modules are currently loaded.

14. / proc/net: network protocol status information.

15. / proc/self: a symbolic link to the process directory of the program that views / proc. When two processes view / proc, this will be different

The connection. This is mainly convenient for the program to get its own process directory.

16. / proc/stat: different states of the system, for example, the number of page errors that occurred after the system started.

17. / proc/uptime: the length of time for the system to start.

18. / proc/version: core version.

/ usr/local is usually the directory where you install the software, which is equivalent to the programefiles directory under windows

/ opt this directory is the installation directory for some large software or some service programs.

For example: the beta version of firefox just installed can be loaded into the / opt/firefox_beta directory, and the / opt/firefox_beta directory contains all the files, libraries, data, and so on needed to run the firefox. To delete firefox, you only need to delete the / opt/firefox_beta directory, which is very simple.

Thank you for reading this article carefully. I hope the article "what is the use of Linux system" shared by the editor will be helpful to everyone? at the same time, I also hope that you will support and pay attention to the industry information channel, and more related knowledge is waiting for you to learn!

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

Servers

Wechat

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

12
Report