1 Historical Linux: LinuxIsNotUnixUnix: it is the predecessor of Linux. because of the charges, it can only be used by companies and schools. a good guy writes a Linux program after he finds himself very good at school. Linux core:
1. History
Linux: Linux Is Not Unix
Unix: it is the predecessor of Linux. because of the charges, it can only be used by companies and schools. a good guy writes a Linux program after he thinks it is very good at school.
Linux core: a kernel-based operating system. Linux brothers only write the kernel (hardware management program)
Linux releases: debian, slackware, suse, Hongqi, turbolinux, redhat, fedora, and mandrake (kernel-dependent tools). peripheral dependencies are written on the Linux kernel, many management hardware tools are written based on the dependency program.
Linux version: r. x. y, r: release version, x: even number, stable version, odd number, development version, y: number of bug fixes, e.g. 2.0.38
2 partitions:
VFS: Virtual File System. all file system interfaces can be programmed according to the interface (polymorphism)
Partition Table: records the partition information. generally, it is located at the beginning of the corresponding partition. a maximum of four records can be recorded. Therefore, a maximum of four extended partitions can be added to the primary partition (generally used to install the system ), the table below records logical partitions (different file systems)
Format: create different file systems, that is, different storage specifications for data.
Why Partition: you can mount a variety of file systems on the same hard disk, a variety of small cells, and different file systems have different small cells. Easier to manage
Windows: c :( primary partition), d :( extended partition/logical partition), e :( extended partition/logical partition)
Linux partition name: all devices are files in Linux, including character devices (such as keyboards) and block devices (such as hard disks)
--/Dev/xxyN,/dev/: directory name of all device files. xx: The first two letters of the partition name indicate the device type of the partition. Usually hd (IDE disk) or sd (SCSI disk ). Y: This letter indicates the device where the partition is located, which represents the hard disk number. N: indicates the partition. the first four partitions (primary and logical partitions) are from 1 to 4, and the logical partitions start from 5. For example:/dev/hda3: The third primary partition or logical partition on the first IDE hard disk,/dev/sdb6: The second logical partition on the second SCSI hard disk.
Access partition: mount is used to associate a partition to a directory. Mount partitions enable storage starting from the specified directory (called a mount point) to be used. For example: mount/dev/cdrom/mnt/cdr
At least two partitions:/partition, SWAP partition: when the hard disk is used as memory (virtual memory), the actual physical memory is twice
3. directory structure: google
4 boot sequence)
Load bios (hardware information)
Read MBR's config to find out the OS: find the operating system to start based on the MBR configuration.
Load the kernel of the OS: core file started by the operating system
Init process starts: init process started
Execute/etc/rc. d/sysinit: run the command
Start other modules (etc/modules. conf): read various modules of the system
Execute the run level scripts:, startup level, start to which level, layered structure, divided into six layers, each layer does not affect each other, can be modified (/etc/inittab)
Execute/etc/rc. d/rc. local: execute the script
Execute/bin/login
Shell started ..
5 linux help
Command -- help
Man command
6 command (commonly used)
Ls: list files and directories in the current directory. ls-l: displays details. ls-R: recursively displays all files in the directory and directories in the directory.
Tree: tree display
Cd: Enter the directory. cd .. the upper path is returned.
Pwd: current path
Mkdir: directory creation
Rmdir: delete an empty directory.
Rm-rf: recursively force delete a directory or file, force delete without jumping out of confirmation information
Touch: create a file
Cp: Copy, cp-r: recursive copy Directory
Mv: mobile, renamed
Vi: text editor (cross-platform, remote), vi file name (create or edit file)
Enter the command mode: only commands can be typed
A: append
Switch to command mode: esc
: W disk, q exited
More: View file content
Cat: View file content
Tac: View file content in reverse order
Head: View files, head-3: view the first three lines of files
Tail: View files; tail-3: list the last three rows
Clear: clear screen
Find: find the location of the file. find/-name my *
Grep (commonly used): name of the grep string file to find the line of the corresponding string in the text file
Whereis: View who executed the Command and its documentation
Echo: echo $ PATH: View PATH
Ln: link. the two files are synchronized, which is different from copy. Ln-s: soft link, equivalent to a windows Shortcut
Useradd: add a user and add the corresponding folder in/home. by default, the group is the same as the user name, and the group name is-g.
Usermod: modify user name,-g: modify group name
Userdel: delete a user
Su user name: Switch User
Passwd: specifies the user password.
More/etc/passwd: all users
More/etc/group: group information
Ls-l: displays detailed information (details ):
First: divided into-: file, l: link, d: Directory
Second to fourth: the owner of the file/directory and the permissions of the owner
Step 5 to Step 7: permission of the file/directory owner for others in the same group
Eighth to tenth: permissions of the remaining persons
Chmod: modify permissions, chmod u + x File name: modify permissions of the current user, chmod g + x File name: modify permissions of the same group, chmod 777: advanced operations, the first 7 indicates the user permission, the second 7 indicates the same group permission, and the third 7 indicates the remaining Member permission. the second 7 indicates the read and write operations (1 indicates the permission, 0 is none.) for example, 7: 111,5: 101.
Chown: modifies the owner and chown owner file name.
Wc: counts the number of lines, characters, and wordcount of a specified text file.
Col: filter control characters
Pipeline: Send the output of one command to another as the input of another command. Command 1 | Command 2 |... command n
Ls-Rl/etc | more
Cat/etc/passwd | wc
Cat/etc/passwd | grep lrj
Dmesg | grep eht0
Man bash | col-B> bash. txt
Ls-l | grep "^ d": list directories
Ls-l * | grep "^-" | wc-l: number of files in the current directory
Wall: wall 'command ', which sends the result of command execution to everyone logging on to the shell.
Command replacement: replace 'command' with the command
Redirection: write command output to a file or read the input command
Output: ls> cmd.txt, ls> cmd.txt,> represents replace,> represents append
Input: wall <aa.txt
Export: this command is required when the environment variable is set in linux to be used by others, such as: export PATH =/home/yyz/Applications/adt-bundle-linux-x86_64-20130917/sdk/tools: $ P
ATH
Ps: observe the following processes: ps-ef: all processes under the current user, ps-ef | grep process name
Kill: kill process, kill-9 process name, and force kill process
Service: service management, service name start: start the service. Service name stop: shut down service, commonly used: service iptables stop, firewall off
Wget URL: locally connect to the website (one of the functions), test
7. build a deployment environment
You must use command lines only because the server uses command lines only.
Service self-start: use of the chkconfig command (startup level and firewall settings (iptables ))