04 Linux cheat sheet directory

  • /: Root directory, in general, only the root storage directory, and only one root directory under linux, everything is from here
    • When the input in a terminal  /home, in fact, is telling the computer to start  /(root directory) to start, then go to the  home directory
  • / Bin, / usr / bin: directory executable binary files, such as the commonly used commands ls, tar, mv, cat, etc.
  • / boot: the boot files used in place linux system, such as linux kernel file: /boot/vmlinuz, system boot manager:/boot/grub
  • / Dev: file storage device linux system, access a file in the directory, which is equivalent to access a device commonly used to mount the CDmount /dev/cdrom /mnt
  • / Etc: system configuration files directory is not recommended to store executable files in this directory, there are important configuration files
    • /etc/inittab
    • /etc/fstab
    • /etc/init.d
    • /etc/X11
    • /etc/sysconfig
    • /etc/xinetd.d
  • / Home: the default user's home directory, create a new user account, the user's home directory are stored in this directory
    • ~ It represents the current user's home directory
    • ~edu It represents the user  edu 's home directory
  • Need help library when the library catalog system, the program in the implementation process, you need to call some additional parameters: / lib, / usr / lib, / usr / local / lib
  • / Lost + fount: the system generates an error exception, the number of lost fragments will be placed in this directory
  • / Mnt: / media: mount point default optical disc, the optical disc is usually mounted at / mnt / cdrom, not necessarily, be mounted at any position can be selected
  • / Opt: to host additional software installation directory display
  • / Proc: The data in this catalog are in memory, such as system core, peripherals, network status, since the data are stored in memory, so do not take up disk space, the more important documents have: / proc / cpuinfo, / proc / interrupts, / proc / dma, / proc / ioports, / proc / net / * etc.
  • / Root: system administrator root's home directory
  • / Sbin, / usr / sbin, / usr / local / sbin: placing executable commands used by the system administrator, such as fdisk, shutdown, mount the like. And / bin difference is that these directories are commands to the system administrator root to use, the average user can only "see" and can not set up and use
  • / Tmp: general user or program being executed temporary storage directory files, anyone can access the important data can not be placed in this directory
  • / Srv: the service started need to access the data directory, Web services need to access data such as www stored in srv / in the / www
  • / Usr: application storage directory
    • / Usr / bin: storage applications
    • / Usr / share: Share data storage
    • / Usr / lib: storage can not be run directly, but some library files necessary to run many programs
    • / Usr / local: storage software upgrade package
    • / Usr / share / doc: system description file storage directory
    • / Usr / share / man: the program documentation storage directory
  • / Var: placement system file execution process often changes
    • / Var / log: Log files are subject to change
    • / Var / spool / mail: e-mail stored in the directory
    • / Var / run: After the program or service is started, its PID is stored in the directory

 

 

/ Dev: directory

dev is the device (device) abbreviation. / Dev directory are very important for all users. Because it contains all the external devices Linux system used in this catalog. But here the driver of the external device is not put, and this
windows, dos operating system is not the same. It is actually one of these ports external device access. We can easily to access these external devices, and access a file, a directory without any distinction.


  Linux Unix followed the style, all equipment is recognized as a file.

  The device is divided into two files: File block device (b) and character device files (c)

  Device files are generally stored in / under the dev directory, device file for the common description as follows:

  / dev / HD [A- T]: the IDE device

  / dev / SD [A- Z]: the SCSI device

  / dev / FD [0-7 ]: standard floppy

  / dev / MD [0-31 of ]: Soft raid devices

  / dev / Loop [0-7 ]: local loop device

  / dev / RAM [0-15 ]: Memory

  / dev / null: Unlimited data receiving apparatus corresponds to a black hole

  / dev / ZERO: zero unlimited resources

  / dev / TTY [0-63 of ]: Virtual Terminal

  / dev / The ttyS [0-3 ]: Serial

  / dev / LP [0-3 ]: Parallel

  / dev / Console: Console

  /dev/fb[0-31]:framebuffer

  /dev/cdrom => /dev/hdc

  /dev/modem => /dev/ttyS[0-9]

  /dev/pilot => /dev/ttyS[0-9]

  / dev / Random: device random number

  / dev / urandom: device random number

  (PS: random number of devices, back I will write blog articles summarize)

  Node under the / dev directory is how to create?

  devf or udev will automatically help you create, too.

  kobject sysfs file system is the basis of, udev to get the newly created device by monitoring, detecting sysfs.

/ Etc: directory

Contains many files. Many network configuration files are in / etc.
/ etc / rc or /etc/rc.d or / etc / rc * .d start, or change the directory scripts or scripts that run when you run the class.
 / etc / passwd User database, which gives the user the domain name, real name, home directory, encrypted password and other user information. 
 / etc / when fstab start mount -a command (in / etc / rc or equivalent startup file) automatically mount the file system list. under Linux, also including with swapon - . information to enable a swap area of
 / etc / group similar to the / etc / passwd, but noted that instead of the user group. 
 / etc / inittab the init configuration file. 
 / etc / Issue getty before the login prompt the output information typically includes a short description of the system or welcome information content determined by the system administrator. 
 / etc / motd of the message at the Day, automatically output after a successful login. content determined by the system administrator. often used to advertise information, as planned shutdown time of the warning. 
 / etc / mtab list of file systems currently installed. initialized by the scripts, automatically updated by the mount command. need to use a list of currently mounted file systems, such as the df command. 
 / etc / Shadow in installed Shadow password file on the shadow password software system. The shadow password fileencrypted password / etc / passwd file is moved to the / etc / Shadow, the latter only readable by the root. This makes it more difficult to decipher the password. 
 / etc / profile login.defs login command. 
 / etc / printcap similar / etc / termcap, but for the printer. different syntax. 
 / etc / Profile, /etc/csh.login, / etc / csh.cshrc login or startup file Bourne or C shells when executed. this allows the system administrator to establish for all users global default environment. 
 / etc / securetty confirm the safety terminal, which terminal that is allowed to log in as root. generally only lists the virtual console, so it is impossible (at least very difficult) to break into the system via modem or network and get superuser privileges. 
 / etc / shells list of trusted shell.chsh command allows the user to change the login shell within the specified range of this document. whether to provide a service process ftpd FTP service machine checks the user's shell is listed in / etc / shells file, if not will not allow the user logs in. 
 / etc / sysconfig network configuration Related Category
/ Proc: directory
Filename contents of the file
 / proc / when the kernel is loaded cmdline issued by the relevant parameters! Check out this file, you can understand how the system is started!
/ proc / Information cpuinfo CPU of the machine, including the clock, and the type of operation function
 / proc / Devices This file records the main device code every major device system, and mknod about it!
/ proc / filesystems current system has been mounted filesystem Lo!
/ proc / interrupts the current state of the system above IRQ assignment.
/ proc / ioports respective current device system configured above the I / O address.
/ proc / kcore this is the size of the memory of it! A big right! But he do not read it!
/ proc / loadavg remember the top and uptime, right? Yes! The average value of the top three is recorded here!
/ proc / meminfo memory usage information listed free, hey! Here it is possible to SEE!
/ proc / modules currently loaded our Linux has a list of modules can also be thought of as a driver for it!
/ proc / mounts data system has been mounted, the call is out of this with the mount command data it!
/ proc / swaps linked to the system in the end where the loaded memory? Ha ha! Use out partition on record in this matter!
/ proc / partitions using fdisk - L appears all current partition, right? In this document which is also a record Oh!
/ proc / PCI bus in the PCI above, the details of each device! Lspci can be used to look up!
/ proc / IT uptime uptime is to use the time, there will be friends!
/ proc / version kernel version, is to use uname - A display of the content it!
/ proc / bus / * number of bus devices, as well as U disk device is also recorded in this oh!

/ Usr: directory

/ usr filesystem is often large, since all programs installed here / usr all files in general from the Linux distribution;. locally installed programs and other stuff in / usr / . This may lower local upgrade or new distribution when the new system no need to reinstall all programs.
 / usr / etc stored settings file
 / usr / games store games and teaching files
 / usr / the include is for C development tools header file
 / usr / report this content share deposit independent structure of the data
 / usr / bin almost all user commands some commands in / bin or / usr / local / . bin in
 / usr / sbin root file system unnecessary system management commands, such as most services programs.  
 / usr / report this content share / man, / usr / report this content share / info, / usr / report this content share / DOC Manual pages, GNU information documents, and a variety of other document files.  
 / usr / the include C programming language header file. for consistency this should actually be in / usr / under lib, but the name has traditionally supported.
 / usr / lib program or subsystems of the same data files, including some site. -wide configuration file name lib comes from library (library); original programming inventory in / usr / . lib in  
 / usr / local locally installed software and other files on here.  
 / usr / src store the program's source code

The type of file

    Regular files (regular file): is the general type of the file, in terms of attributes by the ls -al displayed by the first property [- ]. In addition, in accordance with the contents of the file, and it can be roughly divided into two types of documents:
        Text files (ascii): This is one of the most Unix systems Hello, almost as long as we can use to set all files belong to this one;
        Binary (binary): in addition to normally executable scripts (batch files Text), which is a file format;   
    Directory (directory): is the directory! The first property is [D];
    Link file (link): is similar to Windows shortcuts underneath it! The first property is [L];
    Device files (device): some documents related to the system around, usually focused on / under the dev directory! Usually divided into two types:
    Block (block) device files: that some data is stored, the interface device to provide access to the system, it simply means that the hard disk! For example, your code is number one hard drive / dev / hda1, etc. files it! The first property is [B];
    Character (Character) device files: That is the number of serial port interface device, such as a keyboard, mouse, etc.! The first property is [c].

Linux file system:

Among Linux system, every file has more than the contents of the data file, also includes the various attributes of the file, for example: their group, belongs to the user, the ability to execute, file creation time, file attributes, and so special. We'll contents of each file is divided into two parts store, it is a properties file, the other is the content of the file.
To cope with these two different pound, so the planning ext2 file inode and Block to store each attribute (in which inode) and the file contents (placing them in Block Area). When we want to format a partition
(Format) is ext2, it is necessary to specify the size of the inode and Block for the job, that is, when the partition is formatted as ext2 file system, he must have inode table and the block area of ​​these two regions.
Block has been said earlier, he is the smallest unit of data storage. So what inode that? ! Simply put, Block is an area record "data file content", as the inode is a record, "the relevant properties of the file, and the file contents
Placement information "within which the Block. Simply put, inode file in addition to property records, but also must have the function point (pointer), that point to place the contents of the file into blocks, so the operating system can correctly to 
obtain the contents of the file ah With a group owner of the file (owner
/ Group); The file access pattern; Type of the file; Creation date of the file (ctime), the last read time (atime), last modification time (mtime); The capacity of the file; Characteristic definition file flag (flag), as SetUID ...; The document points to the real content (pointer);

 



    

 

Guess you like

Origin www.cnblogs.com/zhaochengf/p/12128047.html