Ubuntu System directory structure
The following are the main directory structures for the Ubuntu directory, and you'll know a little bit about what files they all contain and don't need memory.
/root directory │ ├boot/startup file. All files related to system startup are saved here │└grub/grub boot-related files │ ├dev/Device files ├proc/Kernel and process mirroring │ ├mnt/Temporary Mount ├media/Mounted Media Device │ ├root/root User's $home directory ├home/ │├user/$home directory for ordinary users │└.../ │ ├bin/System Program ├sbin/Administrator System Program ├lib/System Program Library files ├etc/System programs and the global configuration files for most applications │├INIT.D/SYSTEMV-style startup scripts │├rcx.d/a link to the startup script, defining the Run level │├network/Network configuration file │├x11/Graphical Interface configuration file │ ├usr/ │├bin/applications │├sbin/Administrator Application │├lib/Application Library files │├share/Application Resource File │├src/Application Source Code │├local/ ││├soft/User Program ││└.../usually use a separate folder │├x11r6/Graphical Interface System │ ├var/Dynamic Data │ ├temp/Temporary files ├lost+found/Disk repair Files |
START Process
Linux systems are started primarily with the following steps:
1. Read the MBR information and start boot Manager
Windows uses NTLDR as the boot Manager, and if you have multiple versions of Windows installed on your system, you will need to select the system you want to enter in NTLDR.
Linux typically uses a powerful, configurable grub as the boot manager, and we'll show you how it is used in the Launch Management section.
2, load the system kernel, start the init process
The init process is the root process of Linux, and all system processes are its child processes.
3, the Init process reads the information in the "/etc/inittab" file and goes to the preset run level, running the script under the corresponding folder in the run level in order. Scripts are usually started with the "start" argument and point to a program in a system.
Typically, the startup script under the "/etc/rcs.d/" directory is executed first, followed by the "/etc/rcn.d/" directory. For example, if you set a run level of 3, then its corresponding startup directory is "/etc/rc3.d/".
4, according to the "/etc/rcs.d/" folder in the corresponding script to start the Xwindow server "Xorg", Xwindow for Linux under the graphical user interface system.
5, start the login manager, waiting for users to log in
The Ubuntu system defaults to using GDM as the login manager, and you can log in to the system after you enter your username and password in the Login manager interface. (You can find a link in the "/etc/rc3.d/" folder named "S13GDM")
Change Run level
Find the following in the "/etc/inittab" file:
# the default runlevel.
Id:2:initdefault:
The number 2 in this line is the system's run level, and the default run level has the following meaning:
0 off the machine
1 Single User Maintenance mode
2~5 Multi-user mode
6 reboot
Service Management
A, change the start service
In the folder that corresponds to the run level, you can see a number of startup script links with "s##" and "k##" starting from the file names.
For example:
/etc/rcs.d/s35mountall.sh Mount File System
/etc/rcs.d/s40networking Enable network support
/ETC/RC2.D/S13GDM Start Login Manager
/etc/rc2.d/s20makedev Create a device file
/ETC/RC2.D/S23XINETD Start Super Process
The init process will execute all scripts starting with "s##" in order of file name, with "Start" as the parameter. The smaller the number in the script name, the sooner it will be executed. For example, in the "/etc/rc2.d/" folder, the number in the "S13GDM" file name is less than "s23xinetd" and "S13GDM" will be executed before "s23xinetd".
If a script link starts with "k##", it indicates that it will be executed with a "stop" argument. If the corresponding service does not start, the script is not executed.
For example:
/etc/rc2.d/k20powernowd Power management support for some kind of hardware
If you want to prevent a service from running automatically at startup, you can rename the script in the appropriate run level from "s# #xxx" to "k# #xxx".
b, manual control services
You can also manually run a startup script with the following parameters to control system services.
Start startup
Stop stops
Restart reboot
For example:
/etc/rc2.d/k20powernowd start
Sometimes you don't know the current run level, there is not necessarily a script at the run level, and the first three characters of such scripts are not fixed and are not easy to remember. At this point, you can use the startup script in the "/etc/init.d/" folder directly (the startup script in "/etc/rcx.d/" to link to the corresponding script under the "/etc/init.d/" folder), which is also the way we recommend to you.
For example:
/etc/init.d/powernowd start
Tips: The location of the above command is not included in the search path for environment variables, so enter the full path.
C, common system services
Acpi-support Advanced Power Management support Acpid ACPI Daemon. These two are for power management, very important ALSA Sound Subsystem Alsa-utils Anacron a cron subsystem that will execute the scheduled tasks during the next system run when the system shuts down. APMD ACPI Extension ATD is similar to Cron's task scheduling system. Recommended shutdown The Binfmt-support core supports other binary file formats. Suggest Open Bluez-utiles Bluetooth Device Support Bootlogd start log. Open it Cron task scheduling system, recommended to open Cupsys the printer subsystem. Dbus Messaging bus system. Very important Dns-clean clears DNS information when using a dial-up connection. EVMS Enterprise Volume Management Systems (Enterprise volumn Management System) Fetchmail Mail user agent, for receiving mail GDM Gnome Login and desktop manager. Gdomap Mouse support in the GPM terminal. Halt don't move it. Hdparm the script to adjust the hard disk, the configuration file is "/etc/hdparm.conf". Hibernate system hibernation Hotkey-setup notebook function key support. Support types include: HP, Acer, ASUS, Sony, Dell, and IBM. HotPlug and Hotplug-net Plug and Play support, more complex, it is recommended not to move it. Hplip HP printer and graphics subsystem Ifrename the network interface rename script. If you have 10 network adapters, you should open it inetd in the file "/etc/inetd.conf", comment out all the services you don't need. If the file does not contain any services, it is safe to close it. KLOGD important. Linux-restricted-modules-common restricted module support. The module in the "/lib/linux-restricted-modules/" folder is a restricted module. For example, some drivers, if you do not use a restricted module, you do not need to open it. LVM Logical Volume management system support. Makedev It is important to create a device file. MDAMD disk Array Module-init-tools load extension module from/etc/modules, recommended to open. Networking network support. It is important to activate the network by pressing the "/etc/network/interfaces" file preset. Ntpdate Time Sync Service, recommended shutdown. PCMCIA PCMCIA Device Support. Powernowd Mobile CPU Energy-saving support PPP and Ppp-dns dial-up connections ReadAhead the pre-loading library file. Reboot don't move it. resolvconf automatically Configure DNS Rmnologin Clear Nologin rsync rsync Daemon Sendsigs sends a signal during reboot and shutdown Single Active Single-user mode SSH ssh daemon. Suggest Open Stop-bootlogd Stop the BOOTLOGD service at the 2,3,4,5 run level sudo checks sudo state. Important SYSKLOGD System Log Udev & udev-mab User space dev file system (userspace dev filesystem). Important Umountfs Uninstall File system Urandom Random number generator USplash Boot screen Support Vbesave Graphics BIOS Configuration tool. Save the status of the video card Xorg-common set X service ice socket. Adjtimex the tool to adjust the core clock DIRMNGR Certificate List management tool, working with GNUPG. Hwtools IRQs Optimization Tool The daemon used to repair device file permissions after the Libpam-devperm system crashes. Lm-sensors Onboard sensor support Mdadm-raid Disk Display Manager Screen-cleanup clears the boot screen script XINETD a inetd Super daemon that manages other daemons |
Important configuration Files
In any case, before you modify the configuration file, you should back it up.
We recommend that you use this command: "sudo cp xxx xxx_ ' date +%y%m%d_%h:%m '".
Of course it's a hassle. You can create a new file called "Bak", which reads:
#!/bin/bash
sudo cp $ $1_ ' Date +%y%m%d_%h:%m '
Put it in the directory you can remember, such as "/home", execute the command "Sh/home/bak xxx", you can save the current folder file "xxx" saved as "xxx_yymmdd_hh:mm" format
Global configuration file
/etc/inittab
/etc/timezone
/etc/inetd.conf
/etc/fstab
/etc/mtab
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/sudoers
/etc/shell
/etc/inputrc
/etc/profile
/etc/bash.bashrc
/etc/environment
/etc/updatedb.conf
/etc/issue
/etc/screenrc
/etc/iftab
/etc/hosts
/etc/hostname
/etc/resolv.conf
/etc/network/interfaces NIC configuration file
|
User Configuration file
All files under the "/etc/" directory, only the root user has permission to modify. The global profile of the application software, nor can the normal user be modified, if you want to configure the software to suit your needs, you can modify its user profile.
The user profile is typically a hidden file with the same name as the global configuration file, placed in your $home directory, for example:
/etc/inputrc/home/user/.inputrc
/etc/vim/vimrc/home/user/.vim/vimrc
There are also a few exceptions, usually system programs
/etc/bash.bashrc/home/user/.bashrc