Linux notes utf8 and linuxutf8
Linux file data:/usr/share/doc (in your Linux System)
CLDP Chinese document planning http://www.linux.org.tw/CLDP/
The Linux Documentation Project: http://www.tldp.org/
In terms of enterprise applications, Linux focuses on network servers, critical business applications (financial databases, large enterprise network management environments), and high-performance computing.
Linux in personal environments: desktop computers, handheld systems (PDAs, mobile phones), embedded devices (such as household appliances)
File Name of the device in Linux
IDE Hard Drive/dev/hd [a-d]
SCSI/SATA/USB hard drive/dev/sd [a-p]
USB flash drive/dev/sd [a-p] (different from SATA)
Floppy disk drive/dev/fd [0-1]
Printer 25-pin:/dev/lp [0-2]
USB:/dev/usb/lp [0-15]
USB:/dev/usb/mouse [0-15]
PS2:/dev/psaux
Current CDROM/DVDROM/dev/cdrom
Current mouse/dev/mouse
Tape drive IDE:/dev/ht0
SCSI:/dev/st0
IDE \ Jumper Master Slave
IDE1 (Primary)/dev/hda/dev/hdb
IDE2 (Secondary)/dev/hdc/dev/hdd
The first sector of the disk records two important information:
Install the Boot Management Program 446 bytes in the Master Boot Record (MBR)
Partition table records the entire hard disk partition status 64 bytes
P1:/dev/hda1
P2:/dev/hda2
P3:/dev/hda3
P4:/dev/hda4
In fact, the so-called "split" is for 64 bytes split table settings
The default Partition Table of the hard disk can only write four groups of partition information.
The four groups of split information are called the Primary (Primary) or Extended (Extended) Split slots.
The minimum unit of the split slot is cylinder)
When the system needs to write data to the disk, it must refer to the disk partition table to process data in a partition slot.
First install partition: As long as/and swap
NAT)
SAMBA (add to the windows Network School Environment File Server)
Mail (Mail Server sendmail postfix)
Web (WWW server)
DHCP (the client can automatically obtain IP addresses)
Proxy)
FTP
Partition Method 2:
// Usr/home/var Swap
Book: linux nofb apm = off acpi = off pci = noacpi
Apm: Advanced Power Management
Acpi: Advanced Configuration and Power Interface
Press alt + ctrl + backspace in the image of X.
Ctrl + alt + f1 ~ F6: text interface tty1 ~ Tty6
Ctrl + alt + f7: graphic interface desktop startx
Echo $ LANG
LANG = en_US
Date cal bc +-*/^ %
The Tab is followed by the first word of a string of commands to complete the command.
The Tab is followed by the second word of a string of commands to complete the file
Ctrl + C interrupt command
Ctrl + D keyboard input end of file/end of input
Man page info page
Code content
1. commands or executable files that can be operated by the user in the shell Environment
2. Call functions and tools at the core of the system
3. Some common functions and libraries, most of which are C function libraries (libc)
4 Device File description, usually under/dev
5. configuration files or some file formats
6 games)
7. Conventions such as Linux file system, network protocol, and ASCII code
8. Available management commands of the system administrator
9. kernel-Related Files
Press the button to work
Flip down one page
[Page Down] Flip Down a Page
[Page Up] Page Up
[Home] Go to the first page
[End] Go to the last page
/String: Search for the string from "bottom". If you want to search for vbird, enter
/Vbird
? String: Search for the string from "up ".
N, N use/or? When searching strings, you can use n to continue the next search (whether it is/
Or ?) You can use N to perform reverse search. For example
Search for the vbird string. You can use n to continue the query and use N to go up the query.
To? Vbird: query the vbird string up. Then, use n to continue "up 』
Query, with N reverse query.
Q: end man page this time.
Observe System usage status who netstat-a ps-aux
Sync shutdown reboot halt poweroff
Sync; reboot
Shutdown-h now
Poweroff-f
Init 0;
Run level 0: Shutdown
Run level 3: plain text mode
Run level 5: graphic interface mode
Run level 6: restart
Forgot root Password
Press E to enter grub editing mode
Root (hd0, 0)
Kernel/vmlinuz-2.6.18-128.el5 ro root = LABEL =/rhgb quiet
Initrd/initrd-2.6.18-128.el5.img
In the kernel line, press E again to enter the editing, and enter single
Kernel/vmlinuz-2.6.18-128.el5 ro root = LABEL =/rhgb quiet single
Press enter, and then press B to start the system and enter the maintenance mode for the single user.
Input passwd
Ls-al
Drwx ------ 2 root 4096 Sep 5 14: 09. gconfd
-Rw-r -- 1 root 4204 Sep 4 install. log <= example description
-Rw-r -- 1 root 5661 Sep 4 install. log. syslog
[1] [2] [3] [4] [5] [6] [7]
[Permission] [LINK] [owner] [group] [file capacity] [modification date] [region name]
The first column indicates the file type and permission (permission)
The first character indicates that the archive is "directory, archive, or linked file 』:
O if it is [d], it is a directory, for example, the line named ". gconf" in the above table;
O if it is [-], it is an archive, for example, the line named "install. log" in the above table;
O if it is [l], it indicates link file );
O if it is [B], it is the interface device that can be stored in the device file (random access device );
O if it is [c], it indicates serial port serial backup in the device file, such as the keyboard and mouse (one-time reading device)
The following characters are a group of three parameters, which are a combination of the three parameters of "rwx. [R] indicates readable
(Read), [w] indicates writable (write), and [x] indicates executable (execute ).
Note that the positions of these three permissions will not change. If you do not have the permissions, the minus sign [-] will appear.
O The first group is the "permissions of the archive owner". Take the "install. log" file as an example. The owner of the archive can
Read/write, but not executable;
O the second group is "Same Group Permissions 』;
O The third group is "Other permissions not in this group 』
The second column indicates how many files are connected to this node (I-node)
The third column indicates the "Owner account" of the file (or directory 』
The fourth column indicates the group to which the archive belongs.
The fifth column shows the size of the file. The default unit is bytes.
Column 6 shows the file creation date or the latest modification date.
Column 7 shows the file name of the archive.
Chgrp: Change the group to which the archive belongs
Chown: Change the archive owner
Chmod: changes the permissions of files, and features such as SUID, SGID, and SBIT
-R: Perform recursive changes, that is, all files under the sub-category are changed.
There are nine basic permissions for Linux archives: owner, group, and others.
Read/write/execute permission. Use numbers to represent each permission. The score of each permission is as follows:
R: 4
W: 2
X: 1
The three permissions (r/w/x) of each identity (owner/group/others) must be accumulated,
For example, if the permission is [-rwxrwx ---], the score is:
Owner = rwx = 4 + 2 + 1 = 7
Group = rwx = 4 + 2 + 1 = 7
Others = --- = 0 + 0 + 0 = 0
Chmod [-R] xyz file or directory
Chmod u/g/o/a + (ADD)-(remove) = (SET) rwx file or directory
Chmod u = rwx, go = rx. bashrc
Chmod a-x. bashrc
.: Indicates the current directory, which can also be represented;
..: Indicates the directory on the previous layer, or.
Uname-r
2.6.18-128. el5 <= check the actual core version.
Lsb_release-a <= view the release information
. Indicates the directory at this layer.
... Indicates the directory of the previous layer.
-Represents the previous working directory.
~ Home directory that represents the current user identity
~ Account represents the Home Directory of the account (account is an account name)
Cd: Change directory
Pwd: displays the current directory print working directory
Pwd-P: displays the actual path instead of the link path.
Mkdir: Create a new directory.
Mkdir-mp directory name m Configuration File Permission p recursively create directory
Rmdir: delete an empty directory rmdir-p recursively Delete
Echo $ PATH
# Ls [-aAdfFhilnrRSt] Directory Name
# Ls [-- color = {never, auto, always}] Directory Name
# Ls [-- full-time] Directory Name
Option parameters:
-A: All files, together with hidden files (Files starting with.), are listed (commonly used)
-A: All files, together with hidden files, but not the two objects...
-D: only list the directory itself, not the file data in the directory (commonly used)
-F: directly list the results without sorting them (ls is sorted by file name by default !)
-F: attaches a Data Structure Based on files, directories, and other information, for example:
*: Indicates the executable file;/: indicates the Directory; =: indicates the socket file; |: indicates the FIFO file;
-H: list the file capacity in a readable manner (such as GB and KB;
-I: List inode numbers. The next chapter describes inode numbers;
-L: Serial Output of long data, including the attributes and permissions of files, and other data (commonly used)
-N: list the names of UIDs, not gids, rather than users and groups (UIDGID will be mentioned in account management !)
-R: reversely outputs the sorting result. For example, if the original file name is from small to large, the reverse file is from large to small;
-R: It is listed together with the sub-directories. All files under this directory are displayed;
-S: Sorting by file capacity, rather than by file name;
-T: sort by time, rather than by file name.
-- Color = never: do not display the color based on the file features;
-- Color = always: Display color
-- Color = auto: allows the system to determine whether to give color based on the settings.
-- Full-time: Output in full time mode (including year, month, day, hour, and minute)
-- Time = {atime, ctime}: Output access time or change permission attribute time (ctime)
Instead of the content change time (modification time)
# Cp [-adfilprsu)
# Cp [options] source1 source2 soure3... directory
Options and parameters:
-A: equivalent to-pdr. For details about pdr, refer to the following description. (commonly used)
-D: if the source file is a link file, copy the link file property instead of the file.
Body;
-F: force. If the target file already exists and cannot be enabled, remove the file and try again.
Times;
-I: If the destination file (destination) already exists, you will be asked about the action during overwriting (commonly used)
-L: Create a hard link instead of copying the file;
-P: copy the file together with its attributes, instead of using the default attributes (commonly used for backup );
-R: recursive continuous replication, used for directory replication (commonly used)
-S: copy it into a symbolic link, that is, a "shortcut" file;
-U: If destination is earlier than source, it will update destination!
Note that if there are more than two source files, the last target file must be a "directory!
Rm [-fir] file or directory
Options and parameters:
-F: force's loyalty. Ignore non-existing files and no warning message appears;
-I: interactive mode. Before deletion, the user is asked for actions.
-R: recursively Delete! It is most commonly used to delete directories! This is a very dangerous option !!
# Mv [-fiu] source destination
# Mv [options] source1 source2 soure3... directory
Options or parameters:
-F: force indicates that if the target file already exists, the file will be overwritten without asking;
-I: If the target file (destination) already exists, you will be asked if it is overwritten!
-U: update is performed only when the target file already exists and the source file is updated)
Basename/etc/sysconfig/network
Dirname/etc/sysconfig/network
# Cat [-AbEnTv] tac (reverse list
Options or parameters:
-A: equivalent to the integration option of-vET. It can list some special characters rather than blank spaces;
-B: list the row numbers. Only the row numbers are displayed for non-blank rows. blank rows are not marked!
-E: The ending line break character $ is displayed;
-N: print the travel number, along with the blank line, there will also be a row number, different from the option of-B;
-T: Click the [tab] button to display it with ^ I;
-V: list special characters that cannot be seen
# Nl [-bnw] Archives
Options or parameters:
-B: Specifies the row number. There are two main methods:
-B a: indicates that the row number (similar to cat-n) is also listed no matter whether the row is empty or not );
-B t: if there is a blank row, do not list the row number (default value) for the empty row );
-N: Used to list row numbers. There are three methods:
-N ln: the row number is displayed on the leftmost side of the screen;
-N rn: the row number is displayed on the rightmost side of the field without 0;
-N rz: the row number is displayed on the rightmost side of the field without 0;
-W: The number of digits occupied by the row number field.
More files
Space: Indicates turning a page down;
Enter: Indicates turning "One Line" down 』;
/String: searches for the keyword "string" in the displayed content;
: F: The file name and the number of currently displayed rows are displayed immediately;
Q: The archive content is no longer displayed when you leave more immediately.
B or [ctrl]-B: Indicates turning back to the page. It is only useful for files and useless for pipelines.
Less files
Space key: Flip down a page;
[Pagedown]: Flip down a page;
[Pageup]: Click it to open a page;
/String: searches down for the "string" function;
? String: the "string" search function is enabled;
N: Repeat the previous search (and/or? Related !)
N: Repeat the previous search (and/or? Related !)
Q: Leave the less program;
# Head [-n number] Archives
Option parameter:-n: Followed by a number, which indicates the meaning of several rows.