Ethereum so
Publish: 2021-04-26 06:25:11
1. 1、 Installation and configuration of network devices
when installing Linux, if you have a network card, the installation program will prompt you to give the configuration parameters of TCP / IP network, such as the IP address of the local computer, the IP address of the default gateway, the IP address of DNS, etc, The installation program will automatically compile the network card (Linux system must first support) driver into the kernel. But we must understand the process of loading the network card driver, so we can easily operate when changing the network card and using multiple network cards in the future. The network card driver is loaded into the kernel as a mole, All the network card drivers supported by Linux are stored in the directory / lib / moles / (Linux version number) / net /, for example, the driver of Inter's 82559 series 10 / 100M self-adaptive boot network card is eepro100. O, 3Com's 3c509 isa network card is 3c509. O, dlink's PCI 10 network card is via Rhine. O, NE2000 compatible network card drivers are ne2k PCI. O and ne. O. after understanding these basic drivers, we can change the network card or add the network card by modifying the mole configuration file.
1. Modify the / etc / conf.moles file
this configuration file is an important parameter file to load the mole, Let's first look at a sample file
# / etc / conf.moles
alias eth0 eepro100
alias eth1 eepro100
this file is the content of conf.moles in a Linux system with two inter 82559 series network cards. The alias command indicates the name of the driver that the Ethernet port (such as eth0) has, If you use the command modprobe eth0, the system will automatically load eepro100. O into the kernel, Therefore, it is not necessary to use options in conf.moles to specify the IO address and interrupt number of the network card. However, corresponding to isa network card, you must specify the IO address or interrupt number of the hardware in conf.moles, as shown below, It shows a conf.moles file of NE isa NIC.
alias eth0 ne
Options ne IO = 0x300 IRQ = 5
after modifying the conf.moles file, you can use the command to load the mole, For example, to insert the second network card of inter:
? Insmod / lib / moles / 2.2.14/net/eepro100. O
in this way, the mole eepro100. O can be loaded at the Ethernet port, You can also use the command to view the currently loaded mole information:
[ root@ice /Etc] # lsmod
mole size used by
eepro100 15652 (autoclean)
the meaning of the returned result is that the currently loaded mole is eepro100, with 15652 bytes in size and two users, The method is to clear automatically.
2. Modify the / etc / lilo.conf file
in some relatively new Linux versions, because the operating system automatically detects all related hardware, there is no need to modify the / etc / lilo.conf file at this time, You can modify the lilo.conf file. Add the following command to the / etc / lilo.conf file:
append = & quot; ether=5,0x240,eth0 ether=7,0x300,eth1" <
the meaning of this command is that the IO address of eth0 is 0x240, the interrupt is 5, the IO address of eth1 is 0x300, and the interrupt is 7.
in fact, this statement comes from the parameter passed when the system boot image file,
Lilo: Linux ether = 5,0x240, eth0 ether = 7,0x300, eth1
this method can also make the Linux system configure two network cards, When using more than three network cards, you can follow the same method.
after configuring the network card, you should configure the TCP / IP parameters. In general, when installing the Linux system, you will be prompted to configure the network parameters, You can use the following commands:
? Ifconfig eth0 a.b.c.d netmask e.f.g.h
a.b.c.d is the IP address of eth0, and e.f.g.h is the netmask.
in fact, in Linux system, we can set multiple IP addresses for a network card, such as the following command:
? Ifconfig eth0: 1 202.112.11.218 netmask 255.255.192
then, Use the command "ifconfig - a" to see the interfaces of all network interfaces:
eth0 link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.13.204 Bcast :202.112.13.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
RX packets:435510 errors :0 dropped:0 overruns :0 frame:2
TX packets:538988 e rrors:0 dropped :0 overruns:0 carrier :0
c ollisions:318683 txqueuelen :100
I nterrupt:10 Base address:0xc000
eth0:1 Link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.11.218 Bcast :202.112.11.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
I nterrupt:10 Base address:0xc000 < br />
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask :255.0.0.0
UP LOOPBACK RUNNING MTU:3924 M etric:1
RX packets:2055 errors :0 dropped:0 overruns :0 frame:0
TX packets:2055 errors :0 dropped:0 overruns :0 carrier:0
c ollisions:0 txqueuelen : 0
we can see that there are three network interfaces, eth0, eth0:1, lo, Eth0 is the real Ethernet interface. Eth0:1 and eth0 are the same network card, but they are bound with another address. Lo is the sending address. Eth0 and eth0:1 can use IP addresses of different network segments, which is very useful when the same physical network segment uses different network addresses<
in addition, the network card has a mode of prosimc. In this mode, the network card will receive all the packets in the network. Some network monitoring tools under Linux, such as tcpmp and snort, all set the network card to hybrid mode.
the ifconfig command can change the IP address of the network card ring the running time, but if the system is restarted, the IP address of the network card will be changed, Linux still starts the network interface according to the original default settings. At this time, you can use netconfig or NETCONF command to reset the default network parameters. Netconfig command is to reconfigure the basic TCP / IP parameters, including whether to dynamically obtain IP address (dhcpd and BOOTP), IP address of network card, network mask, default gateway and preferred domain name server address. NETCONF command can configure all network parameters in detail, which is divided into three parts: client task, server task and other configuration. In the client configuration, it mainly includes the configuration of basic host (host name, valid domain name, network alias, IP address of corresponding network card, network mask, network device name, kernel driver of network device), DNS address configuration, default gateway address configuration, NIS address configuration, IPX interface configuration, PPP / slip configuration and so on. In the server configuration, it mainly includes the configuration of NFS, DNS, Apache webserver, samba and Wu ftpd. Among the other configuration options, one is about the host configuration in the / etc / hosts file, one is about the network configuration information in the / etc / networks file, and the last is about the configuration information using linuxconf
under the command of linuxconf, you can also configure the network information, but you can find that the linuxconf program calls NETCONF to configure the network
in addition, the system configuration files about the network are stored in the / etc / sysconfig / network scripts directory. Examples are as follows:
: & lt; br>& lt; br>
ifcfg-eth0 * ifdown post * ifup aliases * ifup PPP *
ifcfg-eth1 * ifdown PPP * ifup IPX * ifup routes *
ifcfg lo * ifdown sl * ifup PLIP * ifup sl *
ifdown @ ifup @ ifup post * network functions
ifcfg-eth0 is the configuration information of Ethernet port eth0, and its contents are as follows:
device = & quot; eth0" /* Specify the network device name * /
IPADDR = & quot; 202.112.13.204" /* Indicate the IP address of the network device * /
netmask = & quot; 255.255.255.192" /* Specify network mask * /
Network = 202.112.13.192 / * specify network address * /
broadcast = 202.112.13.255 / * specify broadcast address * /
onboot = & quot; yes" /* Indicates whether the network card is activated at system startup * /
bootproto = & quot; none" /* Indicates whether to use BOOTP protocol * /
therefore, we can also modify this file to change the network parameters under Linux[/ Size]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -, It introces the files related to the configuration of Linux network services.
1. The configuration file of Lilo
in Linux system, there is a system boot program, Lilo (Linux loadin), which can be used to realize the selective startup of multiple operating systems. Its configuration file is / etc / lilo.conf.in this configuration file, the configuration parameters of Lilo are mainly divided into two parts, One is the global configuration parameters, including setting the boot device and so on. The other is the local configuration parameters, including the configuration parameters of each boot image file. I will not describe each parameter in detail here, but only two important parameters: password and restricted option. The password option adds password protection to each boot image file.
as we all know, In Linux system, there is a single user mode. In this mode, the user logs in to the Linux system as a super user. By adding parameters (Linux single or Linux init 0) ring Lilo boot, people can directly enter the single user mode super user environment without password, This will be very dangerous. So the password configuration option is added in lilo.conf to add password protection to each image file.
you can use the password option in global mode (add the same password to all image files), or add a password to each indivial image file, You may find it troublesome to enter the password every time. You can use the restricted option, which enables Lilo to check the password only when the parameters (such as Linux single) are entered ring Linux startup. These two options can greatly increase the security of the system, It is recommended to set them in lilo.conf file.
since password is stored in plaintext in / etc / lilo.conf file, it is necessary to change the attribute of / etc / lilo.conf file to only root readable (0400).
in addition, in the early version of Lilo, there was a limitation that the boot sector must be stored in the first 1024 cylinder, which was broken in Lilo version 2.51, After downloading and decompressing the latest version, use the command make & quot; Note: physical security is the most basic security, even if the password protection is added in lilo.conf, if there is no password protection in lilo.conf
when installing Linux, if you have a network card, the installation program will prompt you to give the configuration parameters of TCP / IP network, such as the IP address of the local computer, the IP address of the default gateway, the IP address of DNS, etc, The installation program will automatically compile the network card (Linux system must first support) driver into the kernel. But we must understand the process of loading the network card driver, so we can easily operate when changing the network card and using multiple network cards in the future. The network card driver is loaded into the kernel as a mole, All the network card drivers supported by Linux are stored in the directory / lib / moles / (Linux version number) / net /, for example, the driver of Inter's 82559 series 10 / 100M self-adaptive boot network card is eepro100. O, 3Com's 3c509 isa network card is 3c509. O, dlink's PCI 10 network card is via Rhine. O, NE2000 compatible network card drivers are ne2k PCI. O and ne. O. after understanding these basic drivers, we can change the network card or add the network card by modifying the mole configuration file.
1. Modify the / etc / conf.moles file
this configuration file is an important parameter file to load the mole, Let's first look at a sample file
# / etc / conf.moles
alias eth0 eepro100
alias eth1 eepro100
this file is the content of conf.moles in a Linux system with two inter 82559 series network cards. The alias command indicates the name of the driver that the Ethernet port (such as eth0) has, If you use the command modprobe eth0, the system will automatically load eepro100. O into the kernel, Therefore, it is not necessary to use options in conf.moles to specify the IO address and interrupt number of the network card. However, corresponding to isa network card, you must specify the IO address or interrupt number of the hardware in conf.moles, as shown below, It shows a conf.moles file of NE isa NIC.
alias eth0 ne
Options ne IO = 0x300 IRQ = 5
after modifying the conf.moles file, you can use the command to load the mole, For example, to insert the second network card of inter:
? Insmod / lib / moles / 2.2.14/net/eepro100. O
in this way, the mole eepro100. O can be loaded at the Ethernet port, You can also use the command to view the currently loaded mole information:
[ root@ice /Etc] # lsmod
mole size used by
eepro100 15652 (autoclean)
the meaning of the returned result is that the currently loaded mole is eepro100, with 15652 bytes in size and two users, The method is to clear automatically.
2. Modify the / etc / lilo.conf file
in some relatively new Linux versions, because the operating system automatically detects all related hardware, there is no need to modify the / etc / lilo.conf file at this time, You can modify the lilo.conf file. Add the following command to the / etc / lilo.conf file:
append = & quot; ether=5,0x240,eth0 ether=7,0x300,eth1" <
the meaning of this command is that the IO address of eth0 is 0x240, the interrupt is 5, the IO address of eth1 is 0x300, and the interrupt is 7.
in fact, this statement comes from the parameter passed when the system boot image file,
Lilo: Linux ether = 5,0x240, eth0 ether = 7,0x300, eth1
this method can also make the Linux system configure two network cards, When using more than three network cards, you can follow the same method.
after configuring the network card, you should configure the TCP / IP parameters. In general, when installing the Linux system, you will be prompted to configure the network parameters, You can use the following commands:
? Ifconfig eth0 a.b.c.d netmask e.f.g.h
a.b.c.d is the IP address of eth0, and e.f.g.h is the netmask.
in fact, in Linux system, we can set multiple IP addresses for a network card, such as the following command:
? Ifconfig eth0: 1 202.112.11.218 netmask 255.255.192
then, Use the command "ifconfig - a" to see the interfaces of all network interfaces:
eth0 link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.13.204 Bcast :202.112.13.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
RX packets:435510 errors :0 dropped:0 overruns :0 frame:2
TX packets:538988 e rrors:0 dropped :0 overruns:0 carrier :0
c ollisions:318683 txqueuelen :100
I nterrupt:10 Base address:0xc000
eth0:1 Link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.11.218 Bcast :202.112.11.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
I nterrupt:10 Base address:0xc000 < br />
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask :255.0.0.0
UP LOOPBACK RUNNING MTU:3924 M etric:1
RX packets:2055 errors :0 dropped:0 overruns :0 frame:0
TX packets:2055 errors :0 dropped:0 overruns :0 carrier:0
c ollisions:0 txqueuelen : 0
we can see that there are three network interfaces, eth0, eth0:1, lo, Eth0 is the real Ethernet interface. Eth0:1 and eth0 are the same network card, but they are bound with another address. Lo is the sending address. Eth0 and eth0:1 can use IP addresses of different network segments, which is very useful when the same physical network segment uses different network addresses<
in addition, the network card has a mode of prosimc. In this mode, the network card will receive all the packets in the network. Some network monitoring tools under Linux, such as tcpmp and snort, all set the network card to hybrid mode.
the ifconfig command can change the IP address of the network card ring the running time, but if the system is restarted, the IP address of the network card will be changed, Linux still starts the network interface according to the original default settings. At this time, you can use netconfig or NETCONF command to reset the default network parameters. Netconfig command is to reconfigure the basic TCP / IP parameters, including whether to dynamically obtain IP address (dhcpd and BOOTP), IP address of network card, network mask, default gateway and preferred domain name server address. NETCONF command can configure all network parameters in detail, which is divided into three parts: client task, server task and other configuration. In the client configuration, it mainly includes the configuration of basic host (host name, valid domain name, network alias, IP address of corresponding network card, network mask, network device name, kernel driver of network device), DNS address configuration, default gateway address configuration, NIS address configuration, IPX interface configuration, PPP / slip configuration and so on. In the server configuration, it mainly includes the configuration of NFS, DNS, Apache webserver, samba and Wu ftpd. Among the other configuration options, one is about the host configuration in the / etc / hosts file, one is about the network configuration information in the / etc / networks file, and the last is about the configuration information using linuxconf
under the command of linuxconf, you can also configure the network information, but you can find that the linuxconf program calls NETCONF to configure the network
in addition, the system configuration files about the network are stored in the / etc / sysconfig / network scripts directory. Examples are as follows:
: & lt; br>& lt; br>
ifcfg-eth0 * ifdown post * ifup aliases * ifup PPP *
ifcfg-eth1 * ifdown PPP * ifup IPX * ifup routes *
ifcfg lo * ifdown sl * ifup PLIP * ifup sl *
ifdown @ ifup @ ifup post * network functions
ifcfg-eth0 is the configuration information of Ethernet port eth0, and its contents are as follows:
device = & quot; eth0" /* Specify the network device name * /
IPADDR = & quot; 202.112.13.204" /* Indicate the IP address of the network device * /
netmask = & quot; 255.255.255.192" /* Specify network mask * /
Network = 202.112.13.192 / * specify network address * /
broadcast = 202.112.13.255 / * specify broadcast address * /
onboot = & quot; yes" /* Indicates whether the network card is activated at system startup * /
bootproto = & quot; none" /* Indicates whether to use BOOTP protocol * /
therefore, we can also modify this file to change the network parameters under Linux[/ Size]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -, It introces the files related to the configuration of Linux network services.
1. The configuration file of Lilo
in Linux system, there is a system boot program, Lilo (Linux loadin), which can be used to realize the selective startup of multiple operating systems. Its configuration file is / etc / lilo.conf.in this configuration file, the configuration parameters of Lilo are mainly divided into two parts, One is the global configuration parameters, including setting the boot device and so on. The other is the local configuration parameters, including the configuration parameters of each boot image file. I will not describe each parameter in detail here, but only two important parameters: password and restricted option. The password option adds password protection to each boot image file.
as we all know, In Linux system, there is a single user mode. In this mode, the user logs in to the Linux system as a super user. By adding parameters (Linux single or Linux init 0) ring Lilo boot, people can directly enter the single user mode super user environment without password, This will be very dangerous. So the password configuration option is added in lilo.conf to add password protection to each image file.
you can use the password option in global mode (add the same password to all image files), or add a password to each indivial image file, You may find it troublesome to enter the password every time. You can use the restricted option, which enables Lilo to check the password only when the parameters (such as Linux single) are entered ring Linux startup. These two options can greatly increase the security of the system, It is recommended to set them in lilo.conf file.
since password is stored in plaintext in / etc / lilo.conf file, it is necessary to change the attribute of / etc / lilo.conf file to only root readable (0400).
in addition, in the early version of Lilo, there was a limitation that the boot sector must be stored in the first 1024 cylinder, which was broken in Lilo version 2.51, After downloading and decompressing the latest version, use the command make & quot; Note: physical security is the most basic security, even if the password protection is added in lilo.conf, if there is no password protection in lilo.conf
2. Common shell commands of Linux shell
1. Operation commands of file and directory
1. LS command
function: display the information of file and directory
LS displays the list of current directory files by default
LS - a displays all files, including hidden files
LS - L displays file attributes, including size, date, symbolic connection, Whether it is readable, writable and executable
LS - LH displays the file size, prints the file size in an easy to understand format (such as 1K 234m2g)
LS - LT displays the files, and sorts them according to the modification time
2 CD command
function: Rename directory
CD dir, switch to the dir directory under the current directory
CD / switch to the root directory
CD.. switch to the upper level directory
CD.. /.. switch to the upper level directory
Cd ~ switch to the user directory, such as root user, switch to / root
the difference between root directory and home directory:
root directory is the first level file structure of the system, The home directory is just a directory controlled by a non root user. Equivalent to windows my documents, non root users can only control the files in the home directory, not other files in the root directory
the root directory is the top-level directory of the device, which is represented by /
the home directory is the directory where each user logs in to the system, usually under / home, with the user name as the directory, which can be represented by ~
CD / enter the root directory
Cd ~ / enter the home directory
of course, you can also use / home / someone to enter the home directory of someone
3. CP command
function: File
CP source target the file source as target
CP / root / source. Copy the file source under / root to the current directory
eg: CP / home / open_ 038_ dev/external_ files/test/test.sh .
cp –av soure_ dir target_ Dir copies the whole directory, and the two directories are exactly the same
4. RM command
function: delete a file or directory
RM file delete a file
RM - f file delete without prompt. You can use
RM - RF dir with the R parameter to delete the entire directory called dir in the current directory
5. MV command
function: move the file or change its name. If you want to change its name, you can use the command
MV source target to change the name of the file source to target
command parameter:
- B: if you want to cover the file, Backup before covering
- F: force means that if the target file already exists, it will not be queried but will be directly overridden
- I: if the destination file already exists, you will be asked whether to cover it
- U: if the target file already exists and the source is relatively new, it will be updated.
- t: -- target directory = directory move all source arguments into directory, that is, specify the target directory of MV. This option is applicable to the case of moving multiple source files to a directory, where the target directory comes first and the source file comes second
instance 1: change the name of the file
command:
MV test.log test1.txt
instance 2: move the file
command:
MV test1.txt test3
move the files log1.txt, log2.txt, log3.txt to the directory test3
MV log1.txt log2.txt log3.txt test3
move the file log1.txt log2.txt log3.txt to / opt / soft / test / test4 directory
MV - t / opt / soft / test / test4 / log1.txt log2.txt log3.txt
move all the files in the current folder to the upper directory
MV *. /
6 Diff
function: compare file contents
diff dir1 dir2 compare the file lists of directory 1 and directory 2 to see if they are the same, but do not compare the actual contents of the files. If they are different, list
diff file1 File2 compare the contents of file 1 and file 2 to see if they are the same. If they are text format files, different contents will be displayed, If it is binary code, it only means that the two files are different
comm file1 File2 compare files, and display the different contents of the two files
7, LN command
function: establish link. Windows shortcut is based on the principle of linking
ln source_ path target_ Path hard connection
ln - s source_ path target_ Path soft connection
ln is another very important command in Linux. Its function is to establish a different link for a file in another location. The most common parameter of this command is - S. the specific usage is: ln – s source file target file
when we need to use the same file in different directories, we don't need to put the same file in each required directory. We just need to put the file in a fixed directory, and then link it in other directories with LN command, so we don't need to occupy disk space repeatedly. For example: ln – s / bin / less / usr / local / bin / less
http://www.cnblogs.com/joeblackzqq/archive/2011/03/20/1989625.html
2. View file content command
1. Cat command
displays file content, which is the same as DOS type
cat file
2 More command
function: pagination display command
morefile
more command can also be used with other commands through pipeline (|), for example:
PS UX | more
LS | more
3, tail command
function: display the last few lines of the file
tail - N 100 aaa.txt display the last 100 lines of the file aaa.txt
4 VI command
VI file edit file
VI original basic use and command:
the way to enter the command is to first press the [ESC] key, and then enter: w (write file),: W Write the file without asking),: WQ save and exit,: Q exit, q! Exit without saving
5. Touch command
function: create an empty file
touch aaa.txt create an empty file named aaa.txt
3. Basic system command
1. Man command
function: view the help of a command. If you don't know the usage of a command, you can ask him, If he knows, he will tell you back
for example:
man LS displays the help content of LS command
2. W command
function: displays the login user's details
for example:
sarge: ~ # w
22:06:51 up 43 min, 1 user, load average: 0.00, 0.00, 0.00
User TTY from login @ idle jcpu pcpu what
zhoulj PTS / 0 10.140.0.109 21:24 0.00s 0.85s 0.09s sshd: zhoulj [priv]
3. Who command
function: display login user
for example:
sarge: ~ # who
zhoulj PTS / 0 Mar 13 21:24 (10.140.0.109)
4 Last command
function: view the most recent users logging into the system
for example:
sarge: ~ # last
zhoulj PTS / 0 10.140.0.109 mon Mar 13 21:24 still logged in
boot system boot 2.6.8-2-386 mon Mar 13 21:23 (00:43)
zhoulj PTS / 0 10.140.0.105 sun Mar 12 22:51 - down (00:00)
zhoulj PTS pts/0 10.140.0.105 Sun Mar 12 22:51 - 22:51 (00:00)
root tty1 Sun Mar 12 22:50 - down (00:01)
root tty1 Sun Mar 12 22:46 - 22:48 (00:02)
root tty1 Sun Mar 12 22:43 - 22:46 (00:02)
reboot system boot 2.6.8-2-386 Mon Mar 13 06:34 (- 7: - 41)
wtmp beginnings mon Mar 13 06:34:11 2006
5. Date command
function: system date setting
date display current date and time
date - s 20:30:30 set system time to 20:30:30
date - s 2002-3-5 set system period to 2003-3-5
date - S & quot; 060520 06:00:00" The system period is set at 6:00 on May 20, 2006
6. Clock command
function: clock setting
clock – r reads time parameter in system BIOS
clock – w writes system time (such as the time set by date) to BIOS
7 Function: view the system version
uname - R displays the version of the operating system kernel
for example:
sarge: ~ # uname - a
linux Sarge 2.6.8-2-386 # 1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU / Linux
8, shut down and restart the system command
reboot restart the computer
shutdown - r now restart the computer, Restart the computer after the service is stopped
shutdown - h now shut down the computer, shut down the system after the service is stopped
halt shut down the computer
generally, shutdown - r now is used. When the system is restarted, shut down the related services, and so is shutdown - h now
9. Su command
function: switch user
Su - switch to root user
Su - switch to zhoulj user,
note: -, it is very important to use - to use the user's environment variable
http://man.linuxde.net/su
4. Monitor system status command
1. Top command
function: view the usage of system CPU and memory
2 Free command
function: view memory and swap partition usage
for example:
sarge: ~ # free - TM
total used free shared buffers cached
MEM: 187 42 145 06 16
- / + buffers / cache: 19 167
swap: 243 0 243
total: 430 42388
3. Uptime
function: current time, time from system startup to now, number of connected users, system load in the last minute, five minutes and fifteen minutes
for example:
sarge: ~ # uptime
21:54:46 up 31 minutes, 1 user, load average: 0.00, 0.00, 0.00
4 Vmstat command
function: monitor virtual memory usage
for example:
# vmstat
procs memory swap IO system CPU
R B swpd free buff cache si so Bi Bo in CS US sy ID wa
1 00 63704 8100 32272 00 08 3 103 17 0 1 98 1
5 PS command
function: display process information
PS UX display current user's process
PS uxwww display current user's process details
PS aux display all user's processes
PS EF display all system process information
6. Kill Command
function: kill a process, The process number can be obtained by PS command
kill - 9 1001 to kill the program whose process number is 1001
kill all - 9 Apache to kill all the programs whose name is Apache. Kill is not omnipotent, but invalid for the dead program< 5. Disk operation command
1. DF command
function: check the disk space occupation of the file system. You can use this command to get the information of how much space the hard disk is occupied and how much space is left
parameter function
- a list all directories
- ta list all directories, and display file type
- B display block information
- I list all directories with I node
- H display according to daily habits (such as: 1K, 100m For example:
# DF - th
filesystem type size used available use% mounted on
/ dev / sda1 ext3 265m 64M 187m 26% /
TMPFS TMPFS 94m 0 94m 0% / dev / SHM
/ dev / sda6 ext3 714m
1. Operation commands of file and directory
1. LS command
function: display the information of file and directory
LS displays the list of current directory files by default
LS - a displays all files, including hidden files
LS - L displays file attributes, including size, date, symbolic connection, Whether it is readable, writable and executable
LS - LH displays the file size, prints the file size in an easy to understand format (such as 1K 234m2g)
LS - LT displays the files, and sorts them according to the modification time
2 CD command
function: Rename directory
CD dir, switch to the dir directory under the current directory
CD / switch to the root directory
CD.. switch to the upper level directory
CD.. /.. switch to the upper level directory
Cd ~ switch to the user directory, such as root user, switch to / root
the difference between root directory and home directory:
root directory is the first level file structure of the system, The home directory is just a directory controlled by a non root user. Equivalent to windows my documents, non root users can only control the files in the home directory, not other files in the root directory
the root directory is the top-level directory of the device, which is represented by /
the home directory is the directory where each user logs in to the system, usually under / home, with the user name as the directory, which can be represented by ~
CD / enter the root directory
Cd ~ / enter the home directory
of course, you can also use / home / someone to enter the home directory of someone
3. CP command
function: File
CP source target the file source as target
CP / root / source. Copy the file source under / root to the current directory
eg: CP / home / open_ 038_ dev/external_ files/test/test.sh .
cp –av soure_ dir target_ Dir copies the whole directory, and the two directories are exactly the same
4. RM command
function: delete a file or directory
RM file delete a file
RM - f file delete without prompt. You can use
RM - RF dir with the R parameter to delete the entire directory called dir in the current directory
5. MV command
function: move the file or change its name. If you want to change its name, you can use the command
MV source target to change the name of the file source to target
command parameter:
- B: if you want to cover the file, Backup before covering
- F: force means that if the target file already exists, it will not be queried but will be directly overridden
- I: if the destination file already exists, you will be asked whether to cover it
- U: if the target file already exists and the source is relatively new, it will be updated.
- t: -- target directory = directory move all source arguments into directory, that is, specify the target directory of MV. This option is applicable to the case of moving multiple source files to a directory, where the target directory comes first and the source file comes second
instance 1: change the name of the file
command:
MV test.log test1.txt
instance 2: move the file
command:
MV test1.txt test3
move the files log1.txt, log2.txt, log3.txt to the directory test3
MV log1.txt log2.txt log3.txt test3
move the file log1.txt log2.txt log3.txt to / opt / soft / test / test4 directory
MV - t / opt / soft / test / test4 / log1.txt log2.txt log3.txt
move all the files in the current folder to the upper directory
MV *. /
6 Diff
function: compare file contents
diff dir1 dir2 compare the file lists of directory 1 and directory 2 to see if they are the same, but do not compare the actual contents of the files. If they are different, list
diff file1 File2 compare the contents of file 1 and file 2 to see if they are the same. If they are text format files, different contents will be displayed, If it is binary code, it only means that the two files are different
comm file1 File2 compare files, and display the different contents of the two files
7, LN command
function: establish link. Windows shortcut is based on the principle of linking
ln source_ path target_ Path hard connection
ln - s source_ path target_ Path soft connection
ln is another very important command in Linux. Its function is to establish a different link for a file in another location. The most common parameter of this command is - S. the specific usage is: ln – s source file target file
when we need to use the same file in different directories, we don't need to put the same file in each required directory. We just need to put the file in a fixed directory, and then link it in other directories with LN command, so we don't need to occupy disk space repeatedly. For example: ln – s / bin / less / usr / local / bin / less
http://www.cnblogs.com/joeblackzqq/archive/2011/03/20/1989625.html
2. View file content command
1. Cat command
displays file content, which is the same as DOS type
cat file
2 More command
function: pagination display command
morefile
more command can also be used with other commands through pipeline (|), for example:
PS UX | more
LS | more
3, tail command
function: display the last few lines of the file
tail - N 100 aaa.txt display the last 100 lines of the file aaa.txt
4 VI command
VI file edit file
VI original basic use and command:
the way to enter the command is to first press the [ESC] key, and then enter: w (write file),: W Write the file without asking),: WQ save and exit,: Q exit, q! Exit without saving
5. Touch command
function: create an empty file
touch aaa.txt create an empty file named aaa.txt
3. Basic system command
1. Man command
function: view the help of a command. If you don't know the usage of a command, you can ask him, If he knows, he will tell you back
for example:
man LS displays the help content of LS command
2. W command
function: displays the login user's details
for example:
sarge: ~ # w
22:06:51 up 43 min, 1 user, load average: 0.00, 0.00, 0.00
User TTY from login @ idle jcpu pcpu what
zhoulj PTS / 0 10.140.0.109 21:24 0.00s 0.85s 0.09s sshd: zhoulj [priv]
3. Who command
function: display login user
for example:
sarge: ~ # who
zhoulj PTS / 0 Mar 13 21:24 (10.140.0.109)
4 Last command
function: view the most recent users logging into the system
for example:
sarge: ~ # last
zhoulj PTS / 0 10.140.0.109 mon Mar 13 21:24 still logged in
boot system boot 2.6.8-2-386 mon Mar 13 21:23 (00:43)
zhoulj PTS / 0 10.140.0.105 sun Mar 12 22:51 - down (00:00)
zhoulj PTS pts/0 10.140.0.105 Sun Mar 12 22:51 - 22:51 (00:00)
root tty1 Sun Mar 12 22:50 - down (00:01)
root tty1 Sun Mar 12 22:46 - 22:48 (00:02)
root tty1 Sun Mar 12 22:43 - 22:46 (00:02)
reboot system boot 2.6.8-2-386 Mon Mar 13 06:34 (- 7: - 41)
wtmp beginnings mon Mar 13 06:34:11 2006
5. Date command
function: system date setting
date display current date and time
date - s 20:30:30 set system time to 20:30:30
date - s 2002-3-5 set system period to 2003-3-5
date - S & quot; 060520 06:00:00" The system period is set at 6:00 on May 20, 2006
6. Clock command
function: clock setting
clock – r reads time parameter in system BIOS
clock – w writes system time (such as the time set by date) to BIOS
7 Function: view the system version
uname - R displays the version of the operating system kernel
for example:
sarge: ~ # uname - a
linux Sarge 2.6.8-2-386 # 1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU / Linux
8, shut down and restart the system command
reboot restart the computer
shutdown - r now restart the computer, Restart the computer after the service is stopped
shutdown - h now shut down the computer, shut down the system after the service is stopped
halt shut down the computer
generally, shutdown - r now is used. When the system is restarted, shut down the related services, and so is shutdown - h now
9. Su command
function: switch user
Su - switch to root user
Su - switch to zhoulj user,
note: -, it is very important to use - to use the user's environment variable
http://man.linuxde.net/su
4. Monitor system status command
1. Top command
function: view the usage of system CPU and memory
2 Free command
function: view memory and swap partition usage
for example:
sarge: ~ # free - TM
total used free shared buffers cached
MEM: 187 42 145 06 16
- / + buffers / cache: 19 167
swap: 243 0 243
total: 430 42388
3. Uptime
function: current time, time from system startup to now, number of connected users, system load in the last minute, five minutes and fifteen minutes
for example:
sarge: ~ # uptime
21:54:46 up 31 minutes, 1 user, load average: 0.00, 0.00, 0.00
4 Vmstat command
function: monitor virtual memory usage
for example:
# vmstat
procs memory swap IO system CPU
R B swpd free buff cache si so Bi Bo in CS US sy ID wa
1 00 63704 8100 32272 00 08 3 103 17 0 1 98 1
5 PS command
function: display process information
PS UX display current user's process
PS uxwww display current user's process details
PS aux display all user's processes
PS EF display all system process information
6. Kill Command
function: kill a process, The process number can be obtained by PS command
kill - 9 1001 to kill the program whose process number is 1001
kill all - 9 Apache to kill all the programs whose name is Apache. Kill is not omnipotent, but invalid for the dead program< 5. Disk operation command
1. DF command
function: check the disk space occupation of the file system. You can use this command to get the information of how much space the hard disk is occupied and how much space is left
parameter function
- a list all directories
- ta list all directories, and display file type
- B display block information
- I list all directories with I node
- H display according to daily habits (such as: 1K, 100m For example:
# DF - th
filesystem type size used available use% mounted on
/ dev / sda1 ext3 265m 64M 187m 26% /
TMPFS TMPFS 94m 0 94m 0% / dev / SHM
/ dev / sda6 ext3 714m
3. sudo ./configure
sudo make
sudo make install
sudo make
sudo make install
4. Icelandic版
I'm back in þ ig
þ a&th; is so good að be (here)
but stop soon við
br />
ég flý t um í neð hý" eth; i
(at the hotel)
directly related við rafmagnstö fluna
(and næ (Laughter) in gerir mig (leið an)
crime (hæ kick me out a&th; go (help)
ten, ten, ten, ten
ten, ten, ten, ten
ten, ten, ten, ten urine
in the air
(bað að ur ný the more light I get, And I'm so sorry. t, aftengr)
oný the whole breast and food out of sleep-g-angels>
>
>
ththththethethethethethe============== m here once more (anew)
Inside of you
It' s so nice (in here)
But I can' I float around in liquid hybernation I have to go (help)
I explode out and the peace is gone.♪ You, you, you, you, you ♪
I'm back in þ ig
þ a&th; is so good að be (here)
but stop soon við
br />
ég flý t um í neð hý" eth; i
(at the hotel)
directly related við rafmagnstö fluna
(and næ (Laughter) in gerir mig (leið an)
crime (hæ kick me out a&th; go (help)
ten, ten, ten, ten
ten, ten, ten, ten
ten, ten, ten, ten urine
in the air
(bað að ur ný the more light I get, And I'm so sorry. t, aftengr)
oný the whole breast and food out of sleep-g-angels>
>
>
ththththethethethethethe============== m here once more (anew)
Inside of you
It' s so nice (in here)
But I can' I float around in liquid hybernation I have to go (help)
I explode out and the peace is gone.♪ You, you, you, you, you ♪
5. This song is about Maria a close friend of mine who lost herself in drugs she told me to wait for her but guess what... She never came back and I & #; M still waiting she told me: this song is about Maria, a very good friend of mine who lost himself in drugs. She told me to wait for her, but guess what, she never came back. I'm still waiting for her. She told me: wait; til you hear from me Monday, Tuesday it won' t be Wednesday, Thursday we will see If only you can wait baby Wait ' Til you here from me Friday use your fantasy Saturday you got over me if only you can wait baby he really was a friend I remember when we were walking hand in hand She was telling me that she understands All the world and every thrill by taking little pills So she was trying everything and more Alcohol and speed, coke and weed and tried to score Tragedy: she didn' T feel much better than before so she got away here quick to find a better kick, Cocaine, marijuana and illegal drugs. The tragedy is that she didn't feel better than before, so she left here to find more excitement; t forget it - to remind her She' S my sister - wanna tell her how I miss her - she told me never - want to find her can't forget - to remind her that she is my sister - want to tell her how much I miss her - she told me wait; til you hear from me Monday, Tuesday it won' t be Wednesday, Thursday we will see If only you can wait baby Wait ' Til you here from me Friday use your fantasy Saturday you got over me if only you can wait baby wait for me; t call you' ve got to Wait ' til you hear from me Wait - that' s all you' When she arrived in the city of the stars Blinded by the lights, a burning in the heart She believed to play what she called her part A member of society to satisfy her dreams No one paid attention on her skills So she found crack is another way to fill The emptiness inside right now she got her thrill Guess, who gave his life away? She did it every day when she arrived at the prosperous big city, her eyes were dazzled by the light, and her heart was burning with fire. She firmly believed that she wanted to break through a world and become a member of society to meet her dream. No one noticed her skills, so she found another exciting way to fill her emptiness. How about, who let him die, She has never let it - wanna find her can; t forget it - to remind her She' s my sister - wanna tell her How I miss her - she told me Wait ' til you hear from me Monday, Tuesday it won' t be Wednesday, Thursday we will see If only you can wait baby Wait ' Til you here from me Friday use your fantasy Saturday you got over me if only you can wait baby why did she throw her life away? Why did she say don' t call just wait? Why did she fall? Why didn't she contact me just to keep me waiting? If you wanna go to the city of stars Can you help me to find my girl Maria She once was an actress and a beauty queen Then the drugs took over and made her mean I tried to stand by her side make her feel alright But she wished to get over to the other side And since I can' t really get her out of my mind I' m asking you, won' If you want to go to that big city, can you help me find Maria? She used to be an actress, a beautiful queen, but drugs make her degenerate and narrow-minded. I try to stand on her side to make her feel better, but she just wants to go in the opposite direction, and I can't forget her. I beg you, can't you help me find her old me wait till you hear me Monday Tuesday it won' t be Wednesday Thursay we will see if only you can wait baby she told me wait till you hear me Monday Tuesday it won' t be Wednesday Thursay we will see if only you can wait baby wait til you hear from me Friday is fantasy Saturday you got over me
6. There is no article for this keyword; m&35;246; may be &35;8222; Soxleth"means.
7. The network device configuration file of Linux is stored in / etc / sysconfig / network scripts. For the first network device of Ethernet, the configuration file name is generally ifcfg-eth0. If you need to bind one more IP address for the first network device, you only need to create a file named ifcfg-eth0:0 in / etc / sysconfig / network scripts directory. The content example is: device = & quot; eth0:0" IPADDR=" 211.100.10.11Array" NETMASK=" 255.255.255.0" ONBOOT=" yes" Among them, device is the name of the device, IPADDR is the IP address of the device, netmask is the subnet mask, and onboot means to start automatically when the system starts. If you need to bind another IP address, you only need to add one to the file name and eth0: X in the device in the file.
Hot content
