Linux system root files and naming conventions

Source: Internet
Author: User

I. Linux system root file details

Linux The important philosophical thought is actually: Save the program's configuration file in plain text format.

1./boot: system boot files, such as: Kernel files, Iniyrd and Gurb (Bootloarder)

2./dev: directory for device files, device files are also divided into block devices and character devices:

Block devices: Random access by Data block, no order.

Character device: Linear access, per character.

Note: Where the background is black, the font is * * * files, for special files, "1, 0" respectively for the file's main device number and the secondary device number

[Email protected] ~]# ls-l/dev

Bmon2

CRW-RW----1 VCSA TTY 7, 0 Jul 14:20 VCs

CRW-RW----1 VCSA TTY 7, 1 Jul 14:20 VCS1

CRW-RW----1 VCSA TTY 7, 2 Jul 14:20 VC

3./etc: configuration file

4./home : User's home directory, each user's home directory the same city defaults to/home/usename, note in/home, there is no root user house directory.

/root: Administrator's home directory

5./lib: library files, which cannot be executed alone, can be called to encapsulate certain functions.

Where/lib/modules: kernel module files

Static Library:. A

Dynamic library:. dll,.so

Note: When you place a program and its dependent libraries all on another host, it works correctly.

The following contrasts with the ". So" file as an executable shared object format, without the execution portal of the program and can only be called.

The "LS" file is an executable file format.

6./media: Mount a point file for the mobile device, mount the device file in the/lib directory to this file

7./mnt: The mount point for the additional temporary files. Such as: Hard disk

Here's how to use it:

[Email protected] ~]# Ls/dev/cdrom/media

/dev/cdrom

8./opt: Optional Directory, which was used to install third-party noncritical software earlier

9./proc : Pseudo file system, the system is empty before startup, and is stored as "kernel mapping file" for important system tuning files.

[Email protected] ~]# Ls/proc

1 1440 17215 1838 291-481 568-Bus Iomem meminfo Softirqs

1462 1794 18742, 292, 483, cgroups ioports misc Stat

10./sys: a pseudo file system, a property mapping file associated with a hardware device.

[Email protected] ~]# Ls/sys

Block class devices FS kernel power

Bus Dev Firmware hypervisor module

11./tmp: temporary files, each user can build temporary files in this folder, not delete other users ' files, if not used for a long time, the system will automatically clear zero.

[Email protected] ~]# ls-ld/tmp

DRWXRWXRWT. 8 root root 4096 10:00am/ tmp

12./var: changeable files,

[Email protected] ~]# Ls/var

Cache Games Lock NIS run YP

db Lib log opt spool

Empty local mail Preserve tmp

[Email protected] ~]# Ls/var

Cache Games Lock NIS run YP

db Lib log opt spool

Empty local mail Preserve tmp

[Email protected] ~]# Ls/var/run

Auditd.pid Haldaemon.pid SASLAUTHD

Console LVM Screen

Consolekit Mdadm Sepermit

Crond.pid Messagebus.pid Setrans

Cron.reboot Netreport Sshd.pid

Dbus Plymouth syslogd.pid (Process ID number)

Faillock pm-utils utmp

Note:/var/tep is also a temporary file.

[Email protected] ~]# ls/var/tmp/

Ifcfg-eth0.swp

12./bin: executable file, user command

13./sbin: The Management command, puts the program, applies these two programs, may need to use the/lib library, may also use the configuration file in/etc

Why do you need these paths, and why not put them under/bin or/sbin?

/bin or/sbin These programs to start the system itself related to the command or executable program, and /usr/lib,/usr/bin or/usr/sbin is usually the system itself started, in order to provide some functions should have some command or executable program.

14./usr:shared,read-only Global Shared read-only file with the following directory:

There is a separate file system:/usr/local/bin/usr/local/sbin/usr/local/lib is the installation path for third-party software, this file is not a must-have file for non-critical rows


Two.Linux file naming conventions

1. length cannot exceed 255 characters

2. cannot use "/" When file name

3. strictly case-sensitive


Note:

Relative path: Starting at the current position, the file is "." The beginning, of which the "." Can be omitted: cd.x/y=cd x/y

Absolute path: Starting with the root path, the files start with a "/" cd/x


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.