Ethereum trace
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
you can try to uninstall the computer manager and restart it.
The first generation sample gun of xm8 adopts a kind of integrated aiming device, which combines red dot reflective close combat optical sight (CCO), infrared laser indicator and infrared lamp. With one aiming device, the functions of m68cco, an / peq-2 and an / paq-4 are included. This kind of multi in one sight reces the volume and weight. It doesn't need to install different accessories on different positions of guide rail or gearbox like M16 / M4, and it doesn't need to reset each sight separately when zeroing the sight. It can be completed at one time. However, the aiming device of the first generation sample gun has only CCO function, and only space for other function moles is reserved. The reflective sight without magnification enables the shooter to aim with both eyes and capture the target quickly. The backup division is etched on the sight. If the battery is exhausted and can not be replenished in time, it can continue to aim and shoot. In addition, in the early design of xm8, it was required to use the wireless switch to control the various functions of the sight. The shooter can install the wireless switch on any part of the gun body according to his own habits
many items listed in the conceptual design of the second generation xm8 sample gun but not implemented in the first generation sample gun are added to the second generation sample gun. For example, the aiming device of the first generation sample gun has only one function of reflective red dot sight, while the second generation sample gun has realized other functions of the integrated aiming system, and provides two kinds of aiming devices
the first sight is equivalent to the functional combination of CcO and peq-2 currently used in M16 / M4 system. It is generally used for standard or compact or light machine gun type, with a total weight of 272g, including a reflective sight without magnification. The red dot division specification is 1.5moa (1.5 inches above 100 yards), In addition, an infrared laser indicator with an operating distance of 800 meters and an infrared lamp with an operating distance of 600 meters are powered by a lithium battery
the second sight is equivalent to the function combination of ACOG and peq-2. It is generally used for precision shooting or light machine gun, with a total weight of 567g, including a prism positive image sight with magnification of 4x (the same performance as ACOG), and can also reflect a red dot of 1.5moa. In addition, it has infrared laser indicator and infrared lamp with the same performance as the former
Another important change of sight is the redesign of backup sight. In the first generation of sample guns, the backup graation is etched in the sight, while in the second generation of sample guns, the graation is canceled and the traditional mechanical sight which can be folded and stored on the guard wood and handle is used as the backup sight. On the one hand, the soldiers participating in the test suggested that the traditional mechanical sight should be used as the backup sight. On the other hand, if the photoelectric sight was damaged and could not be aligned, the backup sight could not be aligned, so an independent backup sight was designedthe battery life of the sight has also increased from 110 hours to 400 hours, and the new design uses lever clamp instead of screw to fix the sight on the weapon, which is also a response to the soldiers' proposal to have a simpler installation method. In addition, the adjustment of wind deflection and height used to be made by a small wrench that is easy to lose, but now it can be adjusted by a 5.56mm cartridge case or a small coin. In addition, a small and clear click can be heard when adjusting the wind deflection and height. The control switch of the sight is moved from the original side position to the current back position, which makes it easier for soldiers to see and operate. The operation area of the control switch is also increased, and the "up and down" arrow is replaced by the "add and subtract" symbol
Ping is the most commonly used troubleshooting command. It consists of a group of ICMP response request messages. If the network runs normally, it will return a group of response response messages. ICMP messages are transmitted in IP packets, so receiving ICMP response message can indicate that the connections below the third layer are working normally
Cisco's ping command supports not only IP protocol, but also most other desktop protocols, such as IPX and AppleTalk. Let's first take a look at the situation that the ping command supporting IP protocol is executed in exec mode, and then discuss many powerful functions contained in the extended ping command in privileged mode
User execution mode
IP Ping simple IP Ping can be executed in either user mode or privilege mode. Under normal circumstances, the command will send back five response requests, and five exclamation marks indicate that all requests have successfully received the response. The output also includes the maximum, minimum and average round trip time information
every "!" Indicates that an echo response has been successfully accepted, if not "!" The reason why the echo response is not received is:
! Response received successfully
· request timeout
u destination unreachable
P protocol unreachable
n network unreachable
Q source suppression
m cannot be segmented
? The unknown message type
IPX Ping IPX ping command can only be executed on routers running IOS V 8.2 or above. IPX Ping in user mode is usually only used to test Cisco router interface. In privileged mode, users can ping a specific Novell workstation, and the command format is "Ping IPX IPX address"
appletale Ping this command uses Apple echo protocol (AEP) to confirm the connectivity between AppleTalk nodes. It should be noted that the current Cisco router only supports Apple echo protocol for Ethernet interface. The format of the command is "Ping Apple applet address"
privilege execution mode
in privilege execution mode, the extended ping command is applicable to any desktop protocol. It contains more functional attributes, so you can get more detailed information. Through this information, we can analyze the reasons of network performance degradation, not just the cause of service loss. The extended ping command is also executed by typing Ping. The router then prompts for various properties< The usage of extended IP Ping is as follows:
YH router? Ping
protocol [IP]:
target IP address: 165.48.183.12
repeat count [5]: 10
datagram size [100]: 1600
timeout in seconds [2]:
extended commands [n]: y
source address or interface : 165.48.48.3
Type of service [0]:
Set DF bit in IP header? [ no]:
Data pattern [0xABCD]:
Loose, Srict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 10, 1600-byte ICMP Echoes to 165.58.183.12, timeout is 2 seconds:
!!!!!!!!!!
success rate is 100 percent (10 / 10), round trip min / AVG / max = 36 / 39 / 48 MS
first, we discuss the various available attributes of Ping in privilege mode. The default values for each property are shown in parentheses
the protocol needs to be tested
the target address of the test
repeat count if there is intermittent failure or the response time is too slow, the number of Ping repetitions
datagram size if the packet is suspected to be lost e to long delay or segmentation failure, the packet size can be increased. For example, we can use 1600 byte packets to force segmentation
timeout can be increased if it is suspected that the timeout is e to slow response rather than packet loss
extended commands answer OK to get the extended attributes
source address must be the address of the router interface
according to the attributes specified in RFC 791 TOS, the default value of type of service is 0< br />
Set DF bit in IP header? By setting DF bit to prohibit segmentation, even if the message exceeds the MTU defined by the router, the segmentation is also prohibited
the data pattern [0xabcd] can test the noise of the line by changing the data pattern
loose, strict, record, timestamp, verb [none] these are the attributes of IP header. Generally, only record attribute and verb are used, and other attributes are rarely used. Record can be used to record the address of each hop of the message, and the response time of each response is given by the verb attribute
Sweet range of sizes [n] this attribute is mainly used to test large packet loss, slow processing speed or segmentation failure
extended IPX Ping also allows users to modify parameters, such as message size and repeat times. Another enhancement to ping in user mode is the use of the Novell standard echo attribute. With this property, users can ping the workstation on which IPX is loaded. If this property is disabled, Novell IPX devices will not respond to Ping because they do not support Cisco proprietary IPX Ping protocol. Users can modify the properties of devices to support this feature
the extended AppleTalk ping command is an enhancement to ping in user mode, which is similar to the extended IPX Ping. Like IP and IPX extension Ping, users can also select attributes such as verb
trace command
trace command provides the information of every hop from router to destination address. It is realized by controlling the TTL field of IP packets. ICMP response request message with TTL equal to 1 will be sent first. The first router on the path will discard the message and send back the message identifying the error message. The error message is usually an ICMP timeout message, which indicates that the message has successfully reached the next hop of the path, or the port is unreachable, which indicates that the message has been received by the destination address but cannot be transmitted to the IP stack
in order to get the information of round-trip delay time, trace sends three messages and displays the average delay time. Then add 1 to the TTL field of the message and send three messages. These packets will arrive at the second router of the path and return the timeout error or port unreachable message. This method is used repeatedly to increase the value of TTL field until the response message of destination address is received
in some cases, using the trace command may cause a failure. Because there is a trace related bug in IOS. Information about these bugs can be obtained from CCO. Another problem is that some target sites do not respond to ICMP port unreachable messages. When the output of the command shows a series of asterisks (*), you may encounter such a site. The user can use ctrl-shift-6 to interrupt the execution of the command
User execution mode shows the output of a simple trace command executed in user execution mode. The distance to the destination is three jumps. The response message of three packets with TTL value of 1 is ICMP timeout error, and there are two IP addresses of the returned packets. Because router 1 and router 2 are in the same network segment, and their distance to router 3 is one hop, these routers respond to the message< br />
Router3#trace 171.144.1.39
Type escape sequence to abort.
Tracing the route to Router9 (171.144.1.39)
1 Router2 (165.48.48.2) 0 msec
Router2 (165.48.48.2) 0 msec
Router1 (165.48.48.1) 0 msec
2 165.48.48.129 12 msec
Router6 (165.48.49.129) 12 mse C 12 msec
3 router4 (171.133.1.2) 12 msec 12 msec
router9 (171.144.1.39) 12 msec 12 msec
router3
the following lists the different characters and their meanings in the output of IP trace command:
the round-trip delay (in milliseconds) of XY msec before receiving the response message
* message timeout
/> ? The message type cannot be recognized
u port is unreachable
P protocol is unreachable
n network is unreachable
H host is unreachable
Q ICMP source suppression
many attributes of privilege mode extension trace used to extend ping command can be used to extend the function of trace command. The special attributes of the extended trace command are:
numeric display. By default, the output of the trace command includes both the IP address and its corresponding DNS domain name. You can use this property if the user does not need to display the DNS domain name
the default value of probe count is 3, and users can adjust it according to their needs
TTL this value can vary between the maximum and minimum TTL values
port number this is a very useful property that enables engineers to track specific transport layer ports. Therefore, we can not only confirm the IP connectivity between the source and destination, but also confirm whether the high-level services can be accessed
another problem related to the trace command is that if there are multiple paths to the destination, the source address of the returned message may be different. In this case, users need to carefully compare the delay time of different return messages. If you still can't get a clear result, you can access one or more routers on the path remotely, and use the trace command to access the source address and destination address.
Its main advantages are as follows:
full al port simulation memory
real time memory view
support code coverage and other performance testing
supports up to 16 MB trace cache for real-time trace and trigger
it supports batch processing language and can realize automatic debugging
replacing the simulation mole can support different CPUs with JTAG and BDM interfaces
it supports 96 channels and 300MHz sampling rate
support Ethernet communication interface
whr-g300n V2 router, put it in the / home directory of Ubuntu, change the name to rf.bin, and swipe in as follows:
1, Under the condition of normal access to Internet software source, find and enter the "terminal" interface
2. Enter "sudo apt get update" and press enter. Enter the administrator password according to the prompt to update the package information
3. Enter "sudo apt get install TFTP" to start installing TFTP package
4. Hold the reset button of router with toothpick for 10 seconds
5. Unplug the router
6. Connect LAN port and routing LAN port with network cable (don't connect the blue WAN port)
7. Enter "sudo service networking stop" (for Ubuntu 9.10 or earlier) or "sudo service network manager stop" (for Ubuntu 10.4 or above) to shut down the network management service of the system
8. Enter "ifconfig" to see which network card is connected to the router, which is usually the network card with "eth0" code
9. Enter "sudo ifconfig eth0 192.168.11.2" and force the IP of the network card with "eth0" code to 192.168.11.2 (because the default IP in the bootloader of the buffalo router is 192.168.11.1)
10. Enter "sudo ifconfig eth0 netmask 255.255.255.0" to set the mask
11. Enter "sudo ARP - s 192.168.11.1 XX: XX: XX: XX: XX: XX: XX: XX: XX" and "XX: XX: XX: XX: XX" the MAC address of your buffalo router. The MAC address can be found on the label on the back of the Buffalo router, and the colon space is not required
12. Enter "TFTP" and "TFTP & gt;" will appear Prompt
13. Enter "verb" to prompt "verb mode on."
15. Enter "binary" to prompt "mode set to octet."
16. Enter "trace" to prompt "packet tracing on."
17. Enter "rexmt 1" and try to push every second
19. Enter "timeout 60" and the push attempt time should not exceed 60 seconds
20. Enter "connect 192.168.11.1" to connect to the router (in fact, it's not connected, just ready for connection)
21. Enter "put RF. Bin" to prompt failure, and try to push once every one second
22. Connect the power supply of the router, the router will start, and the LED will light up. After about 10-20 seconds, the start of push and the progress of transmission will be displayed
23. After the push transmission is completed, wait 5-10 minutes, the router's red LED flashes, then goes out, and finally the wireless LED lights up, indicating that the firmware is refreshed successfully
24. Enter "quit" to exit the TFTP interface
25.
Enter "sudo service networking start" (for Ubuntu 9.10 or earlier) or "sudo service
network manager start" (for Ubuntu 10.4 or above) to start the network management service of the system
26. Enter "exit" to exit the terminal interface
27.
if the rf.bin file is from the official Buffalo, the routing IP is "192.168.11.1", the network card IP must be "192.168.11. X" to connect, and the user
name is root, and the password is empty; If the rf.bin file comes from openwrt, Gargoyle and DD-WRT, the routing IP is "192.168.1.1", the network card
IP must be "192.168.1. X" to connect, the DD-WRT user name and password are customized, and the default password of Gargoyle is "password".