Ubuntu File System Structure

Source: Internet
Author: User

Ubuntu File System Structure

I. Main directory of Ubuntu File System

Directory Full English name Purpose
/ / The starting point of the entire directory structure. All other files and directories are under it
/Bin Binaries Used to store the most common binary commands
/Boot Boot Contains important Linux boot files, such as grub and kernel files.
/Dev Devices All devices are in this directory, including hard disks and monitors.
/Etc Etc All system configuration files are placed under it
/Home Home Stores the home Directory ($ HOME) of each user and its files and configurations.
/Lib Libraries System library Files, a bit like Windows's Program Files
/Lost + found Lost + found Used to store files lost in case of system exceptions (such as sudden crashes) for recovery
/Media Media Used to load various media, such as optical disks and floppy disks.
/Mnt Mount Used to load various file systems
/Opt Optionally Used to store the "optional (optionally)" program for Installation
/Proc Processes Contains process and other information. It is a memory ing, not a real directory.
/Root Root This directory is the root user's home directory ($ HOME)
/Sbin System-only binaries Used to store system-specific binary commands
/Sys System Used to store system information
/Tmp Temporary files Used to store temporary files
/Usr User Stores applications, library files, and documents of common users.
/Var Variable files Used to store files that change frequently in time, size, and content

 

Ubuntu file system and directory detailed structure/Root directory │ reboot boot/Startup File. All the files related to system startup are stored here │ documents related to javasgrub/grub boot drivers │ kernel/process image │ javasmnt/Temporary mounting ├ media/mount the media device │ ├ root/root user's $ HOME directory ├ home/│ ├ user/common user's $ HOME directory │ └... /│ ├ bin/system program ├ sbin/Administrator System Program ├ lib/system library file ├ etc/global configuration file for system programs and most applications │ ├ init. d/SystemV-style STARTUP script │ javasrcx. d. Link to the startup script, define the running level │ runtime network/network configuration file │ ├ X11/graphical interface configuration file │ ├ usr/www.2cto.com │ bin/Application │ ├ sbin/administrator application │ ├ lib/Application library File │ shareshare/Application resource file │ export src/application source code │ export local/│ ├ soft/user program │ └... /usually use a separate folder │ export X11R6/graphic interface system │ export var/Dynamic Data │ export temp/temporary file restore lost + found/disk repair File System Startup ProcessTo start a Linux system, follow these steps:
1. Read the MBR information and start Boot Manager Windows to use NTLDR as the BootManager. If multiple versions of Windows are installed in your system, you need to select the system you want to access in NTLDR. Linux usually uses the powerful and flexible GRUB configuration as the BootManager. We will introduce how to use it in the startup management chapter. 2. Load the system kernel and start the init process. The init process is the root process of Linux, and all system processes are its sub-processes. 3. The init process reads the information in the "/etc/inittab" file, enters the preset running level, and runs the scripts in the corresponding folder of the running level in sequence. The script is usually started with the "start" parameter and points to a program in the system. Generally, the startup script under the "/etc/rcS. d/" directory is first executed, and then the "/etc/rcN. d/" directory. For example, if you set the running level to 3, the corresponding startup directory is "/etc/rc3.d /".
4. Start the Xwindow server "xorg" Xwindow according to the script in the "/etc/rcS. d/" folder as the graphic user interface system in Linux. 5. Start the logon manager and wait for the user to log on to the Ubuntu system. By default, you can log on to the system after entering the user name and password in the logon Manager interface. (You can find a link named "s13tpd" in the "/etc/rc3.d/" folder.) change the running level ------------ In the "/etc/inittab" file, find the following content: # The default runlevel. id: 2: initdefault: number 2 in this line, which is the system running level. The default running level is defined as follows: 0 shutdown 1 single-user maintenance mode 2 ~ 5-user mode 6 restart Service Management======== Change the startup service ------------ in the folder corresponding to the running level, you can see many startup script links starting with "S #" and "K. For example:/etc/rcS. d/S35mountall. sh mount the file system/etc/rcS. d/S40networking enable Network Support/etc/rc2.d/s13tpd start login Manager/etc/rc2.d/S20makedev create device file/etc/rc2.d/S23xinetd start super Process
The init process uses "start" as the parameter and executes all scripts starting with "S #" in the order of file names. The smaller the number in the script name, the earlier it will be executed. For example, if the number in the "/etc/rc2.d/" folder is smaller than "S23xinetd", "s13tpd" is executed before "S23xinetd. If a script link starts with "K #", it will be executed with the "stop" parameter. If the service is not started, the script is not executed. For example,/etc/rc2.d/K20powernowd supports power management for a certain hardware. If you want to disable automatic running of a service at startup, you can rename the script in the corresponding running level from "S # xxx" to "K # xxx ". Manual control service ---------- you can also manually run the startup script with the following parameters to control system services. Start stop restart for example:/etc/rc2.d/K20powernowd start sometimes you are not clear about the current running level, there may not be corresponding scripts under this running level; in addition, the first three characters of such scripts are not fixed and are not easy to remember. In this case, you can directly use "/etc/init. d/"folder STARTUP script ("/etc/rcX. link the startup script in d/to/etc/init. d/"folder), which is the recommended method. For example:/etc/init. d/powernowd start Tips: The above command is not included in the search path of the environment variable, So enter the complete path. Common system services============== Acpi-support advanced power management supports the acpid acpi daemon. these two subsystems are used for power management and are very important for the alsa sound subsystem alsa-utils anacron cron. They will execute the scheduled tasks during the system shutdown for the next system runtime. The extension of apmd acpi is similar to the cron task scheduling system. We recommend that you disable binfmt-support core to support other binary file formats. We recommend that you enable the bluez-utiles bluetooth device to support bootlogd startup logs. Enable the cron task scheduling system. We recommend that you enable the cupsys printer subsystem. Refers to the message bussystem ). Important dns-clean clears dns information when using a dial-up connection. The evms Enterprise Volume Management system (javasisevolumn Management system) fetchmail email user agent is used to receive emails from the gmtme logon and table manager. Supports the mouse in the gdomap gpm terminal. Halt. Hdparm adjusts the hard disk script. The configuration file is "/etc/hdparm. conf ". Hibernate System sleep hot key-setup Notebook function key support. Supported types include HP, Acer, ASUS, Sony, Dell, and IBM. Hotplug and hotplug-net plug-and-play support is complicated. We recommend that you do not change it. The script for renaming the ifrename network interface of the hpc hp printer and graphics subsystem. If you have ten NICs, you should enable the inetd in the file "/etc/inetd. conf" and comment out all services you do not need. If the file does not contain any services, it is safe to disable it. Www.2cto.com klogd is important. Supported by linux-restricted-modules-common restricted modules. The modules in the "/lib/linux-restricted-modules/" folder are restricted modules. For example, some drivers do not need to be enabled if you do not use restricted modules. Supports the lvm logical volume management system. Makedev is very important to create a device file. The mdamd disk array module-init-tools loads the extension module from/etc/modules. We recommend that you enable it. Networking network support. It is very important to activate the network by pressing the/etc/network/interfaces file. We recommend that you disable the ntpdate time synchronization service. Pcmcia device support. Powernowd mobile CPU energy-saving support ppp and ppp-dns dial-up connections readahead pre-load library files. Reboot. Resolvconf automatically configures DNS rmnologin to clear nologin rsync daemon sendsigs and sends a signal during restart and shutdown to activate the single-user mode ssh daemon. We recommend that you enable stop-bootlogd to stop the bootlogd service sudo check sudo status at the, running level. Important sysklogd System Log udev & udev-monoclonal user space dev File System (userspace devfilesystem ). Important umountfs uninstall File System urandom random number generator usplash boot screen support vbesave graphics card BIOS Configuration tool. Save the status of the video card xorg-common and set X service ICE socket. Adjtimex is the tool used to adjust the core clock dirmngr certificate list. It works with gnupg. The hwtools irqs optimization tool libpam-devperm is used to repair the device file license daemon after the system crashes. Lm-sensors onboard sensors support mdadm-raid disk Display Manager screen-cleanup clear boot screen scripts xinetd manage an inetd super daemon for other daemon Important configuration files===============! In any case, back up the configuration file before modifying it! We recommend that you use this command: "sudo cp xxx _ 'date + % y % m % d _ % H: % m '". Of course, this is very troublesome. You can create a file named "bak" with the following content :#! /Bin/bash sudo cp $1 $1 _ 'date + % y % m % d _ % H: % m' place it in a directory that you can remember, for example, run the "sh/home/bakxxx" command to save the file "xxx" in the current folder as "xxx_yymmdd_HH: MM ". Global configuration file------------ System initialization/etc/inittab running level, number of consoles/etc/timezone Time Zone/etc/inetd. conf super process File System/etc/fstab file system mounted at startup/etc/mtab file system currently mounted user system/etc/passwd user information/etc/shadow User Password/etc /group information/etc/gshadow group password/etc/sudoers Sudoer list (use the "mongodo" command to modify this file, do not directly edit) the Shell/etc/shell available Shell list/etc/inputrc ReadLine control sets/etc/profile user preferences/etc/bash. bashrc bash configuration file system environment/etc/environment variable/etc/updatedb. the conf file retrieves the database configuration information/etc/issue release information/etc/issue.net/etc/screenrc screen setting network www.2cto.com/etc/iftab Nic MAC Address binding/etc/hosts host list/etc /hostname host name/etc/resolv. conf domain name resolution server address/etc/network/interfaces Nic configuration file User Configuration File------------ Only the root user can modify all files in the "/etc/" directory. The global configuration file of the application cannot be modified by common users. If you want to configure the software to meet your needs, you can modify its user configuration file. The user configuration file is usually a hidden file with the same name as the global configuration file, which is stored in your $ HOME directory, for example:/etc/inputrc/home/user /. inputrc/etc/vim/vimrc/home/user /. vim/vimrc has a few exceptions, usually system programs/etc/bash. bashrc/home/user /. bashrc
Ubuntu directory structure/boot: Put the LINUX core and boot-related files in the directory under the VMLIUZ-XXX kernel to start using GRUB directory also has/boot/grub subdirectory

/Dev: All LINUX external devices in the directory. The functions are similar to those of. sys and. vxdLINUX devices and files in DOS. For example,/dev/hda indicates the physical IDE hard disk.

/Etc: During the system startup process, you need to read the LILO parameters, user accounts, and passwords of all directories in the file.

/Home: a user's home directory is named buyu's home directory/home/buyu.

/Lib: The Directory stores the system's basic dynamic link shared library. Similar to the system32 directory in Windows, almost all applications need to use some shared libraries.

/Lost + found: stores files lost due to illegal shutdown, similar to. chk files in windows.
Ubuntu veteran came in and looked at Windows partitions and mounted them directly.

Ii. Main directory structure of Ubuntu
1. The/Linux File System entry is also in the advanced directory;
2. The/bin system requires commands such as ls, cp, and mkdir in this directory; functions and directory files similar to/usr/bin are executed, and common users use commands as the basic system.
3. The directory required for the boot Linux kernel and boot system programs is located in the directory where GRUB or LILO System boot manager is located.
4,/dev device file storage directory ratio: Sound Card, disk ......
5. Some server configuration files in the/etc system configuration file are also in the same directory.
6. The/home ordinary user's home directory is stored by default;
7./lib library file storage directory
8, /lost + found ext2 or ext3 file system when the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are generated. When the system starts, The fsck tool checks and fixes damaged file systems. A system problem occurs. If multiple files are moved to the directory, they can be manually repaired or moved to the original file location.
9, the/mnt directory is used to store the mounted storage device. For more information about the mounted directory than the cdrom directory, see the/etc/fstab definition. Sometimes we will enable the system to automatically mount the file system to put the mount point in. /etc/fstab defined; better than optical drive mounting/mnt/cdrom
10. opt indicates that some software packages will also be installed and custom software packages will be installed in the installation directory of some of our self-compiled software packages compared with those of Fedora Core 5.0OpenOffice. /configure -- prefix =/opt/directory
11. Process Information and kernel information (such as cpu, hard disk partition, and memory information) during running of the/proc Operating System) store in/proc directory disguised File System proc Mount directory proc and real file system definition see/etc/fstab
12./root Linux root directory;
13. Most of the/sbin operations involve system management commands to store super-privileged users. The root user executes commands to store the command directories and/usr/sbin in directories that ordinary users do not have the permission to execute; /usr/X11R6/sbin or/usr/local/sbin directory is similar. We remember that all directories containing sbin can be executed only with root permissions.
14./tmp temporary file directory sometimes the user will generate a temporary file/tmp when running the program to store the temporary file/var/tmp directory is similar to the directory
15, /The usr system stores multiple files and directories in the directory such as commands and help files. When we install the official software package of the Linux release, most of the installation involves the server configuration file and the configuration will be file Installation/etc directory/usr directory contains the/usr/share/fonts help directory/usr/share/man or/usr/share/doc common user execution file directory/ usr/bin or/usr/local/bin or/usr/X11R6/bin super permission User root executes command to store directory ratio/usr/sbin or/usr/X11R6/sbin or/usr /local/sbin; there is also a program header file directory/usr/include
16. The content of the var directory is changed frequently. See the name. We understand that/var/log is available under the abbreviation of vary/var to store system logs./var/www defines the directory for storing Apache server sites; /var/lib is used to store some library files, which is better than that of MySQL and MySQL databases;

Important subdirectories of Ubuntu below
1. the/etc/init. d directory is used to store the System or Server System V mode STARTUP script System V mode startup or initialization System;
2. the/etc/xinit. d server uses the xinetd mode to run scripts. Some systems do not have directories. Some earlier versions of Slackware do not have Rehat/Fedora compared with new versions.
3. the/etc/rc. d Slackware release has the directory BSD mode to start the script storage location, such as defining the Enable script for the NIC server.
4,/etc/X11 X-Windows-related configuration file storage location
5. Normal users in the/usr/bin directory have the permission to execute the program; when we install programs from the built-in software package, most of the execution files will be placed in a directory similar to/usr/local/bin when installing the gaim software package; sometimes/usr/binfile/usr/local/bin link file;
6. the/usr/sbin directory also executes program directories. Most of these directories store system management commands that can be executed only with root permissions; similar directories:/sbin or/usr/local/sbin or/usr/X11R6/sbin
7. the/usr/local directory is used to store the user's self-compiled and installed software storage directory. For example, if the source code package is used to install the software, the installation directory has a subdirectory.
8,/usr/share system shared item storage ratio/usr/share/fonts font directory/usr/share/doc and/usr/share/man help file
9,/usr/src kernel source code directory than the following kernel source code directory than linux, linux-2.xxx.xx directory and other systems will also install the source code package than Fedora/Redhat when we install file. src. the/usr/src/redhat Directory will be installed in the software package at rpm.
10. System header files required for/usr/include application development. All important C/C ++ header files are in the l Directory: stdio. h
Unistd. h
11. system library files required for/usr/lib application development. Multiple important C/C ++ library files are in the file: libstdc ++,
C.

Related Article

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.