Well-written linux Study Notes: linux directory architecture/root directory/bin Common commands binary file contents/boot stores files that must be read when the system starts, including the core (kernel) in/boot/grub/menu. lst GRUB settings/boot/vmlinuz kernel/boot/initrd core unlock required RAM Disk/dev system peripheral devices/etc system related settings file/etc/DIR_COLORS set color/etc/HOSTNAME set the user's node name/etc/NETWORKING. Only YES indicates that the network exists/etc/host. the conf file describes how the user's system queries the node name/etc/hosts and sets the corresponding table/etc/hosts for the user's own IP address and name. allow settings allow machines that use inetd to use/etc/hosts. the deny setting does not allow machines that use inetd to use/etc/host. S. equiv does not need a password for the remote host/etc/inetd. conf sets the configuration of the system network daemon inetd/etc/gateways and sets the vro/etc/protocols to set the protocols supported by the system/etc/named. boot sets the local machine to name the server's configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 to set IP/etc/resolv. conf sets the DNS/etc/X11 X Window configuration file, xorg. conf or XF86Config the two X Server's preset hosts/etc/fstab records the file system to be mounted upon startup/etc/inittab sets what the init process will set the system to when the system starts runlevel/etc/issue records the information displayed before User Logon/etc/group sets the user's group name and related information/etc/passwd account Information/etc/shadow password/etc/sudoers can be set in the configuration file/etc/securetty Of The sudo command to enable root login to/etc/login. the default/etc/exports configuration for all defs users to log on to/etc/init. d. All the server's preset scripts are stored here. For example, you need to activate or disable/etc/xinetd. d/This is the configuration item/etc/modprobe of the server in the region managed by the super daemon. additional parameter settings for the conf kernel module/etc/syslog. conf log setting file/home user's home directory/lib system will use the function library/lib/modules kernel related modules/var/lib/rpm suite installation/lost + found System when an exception occurs, some missing fragments will be placed outside/mnt The mount point/media and/mnt are similar to the/opt host's additional installed software/proc virtual directory, is the memory ing/proc/version kernel version/proc/sys/kernel system kernel function/root system administrator's home directory/sbin system administrator can execute commands/srv some services after the action, the resources required for these services are/tmp, which is the largest directory of the local/usr In the case when a general user or a program is being written, save applications and files/usr/X11R6: X-Window directory/usr/src: Linux source code/usr/include: the system header file/usr/openwin stores SUN's OpenWin/usr/man online user manual/usr/bin users can upload binary files. the function library used by the binary file/usr/lib system. Command executed by the/usr/local/lib System Administrator/usr/sbin System Administrator/usr/local/sbin command/var log file/var /log/secure log on to the system to access the data, for example, pop3, ssh, telnet, ftp, and so on will all remember the information of the/var/log/wtmp reporter login in this case, last/var/log/messages depends on the generation of dynamic transmission messages/var/log/boot. when log service is enabled or when some services are active, indicates whether the specified dynamic or related messages/var/log/maillog have been accessed or retrieved (sendmail and pop3) user logs/var/log/cron logs crontab content of this routine service/var/log/httpd,/var/log/news, /var/log/mysqld. log ,/Var/log/samba,/var/log/procmail. log: some common basic commands are used to remember different network services: uname-a view kernel version ls-al display all file properties pwd display current path cd-return the last directory cd ~ Return home directory date s set time, date cal Show Calendar cal 2006bc calculator with man & info help manual locale show current font locale-a all available fonts/etc/sysconfig/i18n set file LANG = en use the English font sync to write data to the hard drive shutdonw-h now & half & poweroff shutdown reboot restart startx & init 5 to enter the graphic interface/work &? Click work to search for the document content. Change the chgrp testing of the archive group to install. log chown changed its owner chown root: root install. logchmod changed the attribute chmod 777 install. log read = 4 write = 2 execute = 1cp copy cp filenamerm delete file rm-rf filename force delete file rmdir Delete folder mv move mv 123.txt 222.txt rename mkdir create folder touch create file update current time cat is displayed starting from the first line. cat | more pages. nl adds the row number more & less to the content to flip the head-n filename to display the tail-N filename to display the last n rows. content od display non-pure document df-h display partition space du display directory or file size fd Isk partition settings fdisk-l/dev/hda display hard disk partition status mkfs establish various file systems mkfs-t ext3/dev/ram15 fsck check and repair LINUX File ln hard link ln-s software Link whereis SEARCH Command locate find/-name "***. * ** "which viewing tool whoami display current user gcc-v view GCC version chattr + I filename prohibit deletion chattr-I filename cancel disable lsattr display hidden file attribute updatedb update database mke2fs format mkfs -t ext3 dd if =/etc/passwd of =/tmp/passwd. bak backup mount list all system partitions mount-t iso9660/dev/cdrom/mnt/cdrom mount-t Vfat/dev/fd0/mnt/floppy mount a floppy disk mount-t vfat-o iocharset = utf8, umask = 000/dev/hda2/mnt/hda2 mount fat32 partition mount-t ntfs-o nls = utf8, umask = 000/dev/hda3/mnt/hda3 mount the ntfs partition Linux-NTFS Project: http://linux-ntfs.sourceforge.net/umount/mnt/hda3 mounted ifconfig display or set network device service network restart Nic ifdown eth0 disable Nic ifup eth0 enable Nic clear screen history! 55. Execute the 55th command stty to set the Job Schedule of the terminal stty-afdisk/mbr to delete the GRUBat worker. The crontab runs the routine command of the worker line [e] for editing, [l] display, [r] Delete the task and run the background program tar-zxvf 123.tar.gz & ---------> run jobs in the background to watch the program jobs-lfg paused in the background and set the background program to fg n in the foreground ------> n is a number, you can specify the program bg to enable the worker to run the kill termination process in the background. kill-9 PID [9] is forcibly terminated, and [15] Ends normally, [l] list available kill signal ps aux view background program top-d 2 update every two seconds top-d 2-p10604 watch a PID top-B-n 2>/tmp/top.txt -----> perform the top information twice, then the result is output to/tmp/top.. Txt pstree uses A tree chart to display the program [A] using ASCII to parse, and [u] to list the PID, [p] to list accounts for killall, You need to delete a certain service (killall-9 httpdfree) to display the memory status free-m --------> display the uptime in MB. display the current system boot time netstat to display the network status netstat-tulnp ------> Find the network type and PIDdmesg that have been listened to on the current system and display the boot information demsg | morenice sets the priority nice-n-5 vi & -----> use root give a nice image-5, when using dynamic row vi renice to adjust existing priority runlevel display current runleveldepmod Analysis of dependency of loaded modules lsmod show loaded system module modinfo display information of kernel module insmod loaded module modprobe automatic Handle the chkconfig check of the rmmod deletion module of the module that can be loaded, set various system services chkconfig -- list -----> list various service statuses ntsysv set various system services cpio Backup File compression commands :*. the execution case of the Z compress program zookeeper ;*. bz2 bzip2 program zookeeper case ;*. ;*. the resources packaged by the tar program have not been deleted. * The example of the tar package of the .tar.gz program is, the compressed file named compress filename after gzip is added with [-d] uncompressgzip filename and [-d] decompress zcat 123.gz to view the compressed file content bzip2-z filename [-d] decompress bzcat filename.bz2 to view the compressed file content tar-cvf/home/123.tar/etc, Uncompress tar-xvf 123.tar uncompress the package tar-zxvf/home/123.tar.gz and decompress tar-jxvf/home/123.tar.bz2 with bzip2 to unzip tar-ztvf/tmp/etc.tar.gz- covB> [file | device] cpio-icduv <[file | device] restore vi General Usage general mode edit mode command mode h left, i, r, o, A, I, R, O: w save j and enter the editing mode: w! Force save k and dd to delete the current cursor row: q! Do not save leave l right ndd Delete n rows: wq! Save and move from 0 to the beginning of the row yy copy the current row: e! Restore original file $ move to the end of the row nyy copy n rows: w filename Save As H screen top p, P paste: set nu set row number M screen center u undo: set nonu cancel row number L at the bottom of the screen [Ctrl] + r redo the last action ZZ save exit G file last line [ctrl] + z pause Exit: set nohlsearch permanently disables highlight/work downward search: Does sp open two documents at the same time? Search [Ctrl] + w for work and move gg to the first line of the file: nohlsearch temporarily disable highlighted display understand SHELLalias display all current command aliases alias lm = "ls-al" command alias unalias lm cancel command alias type similar to whichexprot setting or display environment variable exprot PATH =" $ PATH ": /sbin Add/sbin in PATH echo $ PATH Display PATH bash enter subroutine name = yang set variable unset name cancel variable echo $ name DISPLAY variable content myname = "$ name its me "& myname = '$ name its me' $ variable content missing $ name in single quotes ciw =/etc/sysconfig/network-scripts/set path env list all environment variables echo $ RANDOM display at will number of instances Set SHELLPS1 = '[/u @/h/w/A #/#]/$' set the prompt character [root @ linux ~] # Read [-pt] variable ----------- number of variables used to read the keyboard input:-p: the backend can receive a prompt! -T: the backend can be connected to the "seconds !』 Declare declares the shell variable ulimit-a to display all restrictions. ls/tmp/yang & echo "exist" | echo "not exist" means, if the row ls/tmp/yang is correct, echo "exist" is returned. If there is a problem, echo "not exist" echo $ PATH | cut-d': '-f 5 is a separator, read 5th-segment content export | cut-c 10-20 read 10th-20 bytes of content last | grep 'root' search for a row with root, add [-v] reverse search cat/etc/passwd | sort display cat/etc/passwd | wc display regular expression of "line, word count, number of bytes" [root @ test root] # grep [-acinv] 'search for the keyword 'filename' metric data description:-: Search for binary classification data using text encoding.-c: count the number of times that the 'search for character string' is found.-I: Ignore the difference in the size of the string, therefore, when the size is the same as-n: Then, the user will be redirected to-v: The reverse selection, that is, the line indicating that there is no 'search character string' content! Grep-n '123.txt search for the character ----------- search for a specific string grep-n' t [ea] st'123.txt search for the test or taste two characters --------- use [] to search for the Collection character grep-n '[^ g] oo '123.txt search for oo ----------- with the selected character [^] grep-n' [0-9] '123.txt 0-9 the number grep-n '^ the '123.txt Search Start with the line ----------- start of the line search ^ grep-n' ^ [^ a-zA-Z] '123.txt search is not in English start with a letter grep-n' [a-z] $ '123.txt search for rows ending with a-z ---------- search at the end of a row $ grep-n' g .. d '123.txt Search Start with g and end with d character ---------- any character. grep- N 'ooo * '123.txt search has at least two oo characters --------- heavy character * sed text stream editor uses script commands to process text files awd Mode Scanning and processing language nl 123.txt | sed' 2, 5d 'delete content from the second to fifth rows diff Compare file difference cmp compare two files difference patch file pr to print file format account management/etc/passwd SYSTEM account information/ the password information of the etc/shadow account is encrypted with MD5 32-bit encryption and "*" is added in front of the password column 『*』『! "Disable the use of an account/etc/group system group information/etc/gshadownewgrp to change the logon group useradd & adduser to create a new user ---------> useradd-m test to automatically create the user's logon directory useradd-m- g pgroup test ---------> specify the level/etc/default/useradd related settings/etc/login. defs UID/GID-related passwd Change Password -----------> passwd testusermod Change User Account userdel Delete account -----------> userdel-r testchsh change the SHELL used to log on to the system [-l] display available SHELL; [-s] modify your own SHELLchfn change the information displayed in the finger command finger find and display the user information id show the user ID ------ -----> Id testgroupadd Add add group groupmod is similar to usermod groupdel Delete group su test Change User su-enter root, use the root environment variable sudo to execute the command mongodo to edit/etc/sudoers and add a line "test ALL = (ALL) ALL" % wheel ALL = (ALL) ALL users in the ALL system can use sudo % wheel ALL = (ALL) NOPASSWD: ALL users in the wheel group do not need to use the NOPASSWD User_Alias ADMPW = vbird, dmtsai, vbird1, vbird3 joins ADMPW group admpw all = NOPASSWD :! /Usr/bin/passwd,/usr/bin/passwd [A-Za-z] *,/! /Usr/bin/passwd root can change the user password, but cannot change the root password (add it before the command! Cannot be) PAM (Pluggable Authentication Modules, embedded Mode) who & w check who has logged on to the host online last time lastlog recently read/var/log/lastlog talk with other users write send information write test [ctrl] + d send mesg settings terminal write permission mesg n prohibit receiving mesg y wall send information to all users wall this is q testmail write mail/etc/default/useradd home directory default settings quota display disk already the space used and the limit quota-guvs -----> show the current root quota limit value quota-vu query quotacheck check disk space and limit quotacheck-avug -----> set all/ etc/m In the tab, the partitions supported by quota are scanned for [-m]. To forcibly scan a quota, it must be an independent partition with quota. user and quota. the two files of group are added to/etc/fstab:/dev/hda3/home ext3 defaults, usrquota, kgquota 1 2 chmod 600 quota, restart edquota to edit the quota [u] user of the user or group, [g] group, [p] copy, [t] set the grace period edquota-a yang edquota-p yang-u young -----> copy quotaon to enable disk space limit quotaon-auvg --------> disable all filesystemquotaoff with quota to disable the disk space limit quotaoff-a --------> the limit of quota is disabled. Generate repquota-av to query all the quota-enabled filesystems in the kernel system. Specify the Quota threshold from the beginning to the end of the entire configuration. probably: 1. Set the filesystem of partition to support the quota. As a result, quota must support the filesystem on partition. Generally, ext2/ext3 is the best support level, I have never heard of other filesystem-type programmers! The maximum number of physical filesystems supporting quota is physical memory/etc/fstab, so that the physical disk to be opened can support quota memory. 2. Create a quota record store: the limit was previously reached. The limit on the number of physical disks in the whole quota operation was aquota. user/aquota. group. To create these two cases, you must first use quotacheck for scanning! 3. Limit the quota: edquota is used to limit the available quota of each user or group; 4. Repeat and trigger the quota: After setting the quota, the suggestion is that you can perform the quotacheck again, and then use quotaon to activate the quota! Introduction to the boot process 1. Import the hardware information of the BIOS and obtain the first token on the machine; 2. Retrieve the startup information of the boot Loader (lilo, grub, spfdisk, etc.) of the First MBR on the machine; 3. Access the core information of the Kernel operating system. The Kernel starts to solve the problem and updates all hardware settings; 4. run the init program and get the run-level information. 5. run the init program line/etc/rc. d/rc. sysinit modeling case; 6. External modeling of the mobile core (/etc/modprobe. conf); 7. run-level statement (Scripts) of the init primary line; 8. init primary line/etc/rc. d/rc. local hosts; 9. Check the/bin/login program and wait for the user to log on. 10. Start to control the host using Shell after logon. In/etc/rc. in d/rc3.d, start with S as the boot time, and close with K as the start time, the subsequent numbers represent the execution sequence GRUB vga set color/Resolution 640x480 800x600 1024x768 1280x1024 bit 256 769 771 773 775 8 bit 32768 784 787 790 15 bit 793 785 788 791 794 16 bit 16.8 M 786 789 792 32 bit. /configure check system information. /configure -- help | more help information make clean clear the files left before make compile make install rpm-q -----> query whether to install rpm-ql ------> query all directories of this suite rpm -qi -----> description of the query kit rpm-qc [d] -----> configuration file and description file rpm-ivh ----> install rpm-V --------> check whether the kit has been updated with rpm- e ------> Delete rpm-Uvh -------> Upgrade and install -- nodeps -----> force install -- test -----> test and install