> **Attention**: commands here are taking advantage of byte-code-injection, which means we are injecting some [aspects](https://en.wikipedia.org/wiki/Aspect-oriented_programming) into the current classes for monitoring and statistics purpose. Therefore when use it for online troubleshooting in your production environment, you'd better **explicitly specify** classes/methods/criteria, and remember to remove the injected code by `stop` or `reset`.
> **Attention**: commands here are taking advantage of byte-code-injection, which means we are injecting some [aspects](https://en.wikipedia.org/wiki/Aspect-oriented_programming) into the current classes for monitoring and statistics purpose. Therefore, when using it for online troubleshooting in your production environment, you'd better **explicitly specify** classes/methods/criteria, and remember to remove the injected code by `stop` or `reset`.
@ -40,8 +40,8 @@ You can see that there is currently a background job executing:
When the job is executing in the foreground, for example, directly executing the command `trace Test t`, or executing the background job command `trace Test t &`, then putting the job back to the foreground via `fg` command, the console cannot continue to execute other command, but can receive and process the following keyboard events:
When the job is executing in the foreground, for example, directly executing the command `trace Test t`, or executing the background job command `trace Test t &`, then putting the job back to the foreground via `fg` command, the console cannot continue to execute other command, but can receive and process the following keyboard events:
* ‘ctrl + z’: Suspend the job, the job status will change to `Stopped`, and the job can be restarted by `bg <job-id>` or `fg <job-id>`
* ‘ctrl + z’: Suspends the job, the job status will change to `Stopped`, and the job can be restarted by `bg <job-id>` or `fg <job-id>`
* ‘ctrl + c’: Stop the job
* ‘ctrl + c’: Stops the job
* ‘ctrl + d’: According to linux semantics this should lead to exit the terminal, right now Arthas has not implemented this yet, therefore simply ignore this keystroke.
* ‘ctrl + d’: According to linux semantics this should lead to exit the terminal, right now Arthas has not implemented this yet, therefore simply ignore this keystroke.
## 4. fg/bg, switch the job from the foreground to the background, and vise verse
## 4. fg/bg, switch the job from the foreground to the background, and vise verse
@ -60,7 +60,7 @@ $ trace Test t >> test.out &
The trace command will be running in the background and the output will be redirect to `~/logs/arthas-cache/test.out`. You can continue to execute other commands in the console, at the same time, you can also examine the execution result from the output file.
The trace command will be running in the background and the output will be redirect to `~/logs/arthas-cache/test.out`. You can continue to execute other commands in the console, at the same time, you can also examine the execution result from the output file.
When connect to a remote Arthas server, you may not be able to view the output file on the remote machine. In this case, Arthas also supports automatically redirecting the output to the local cache file. Examples are as follows:
When connected to a remote Arthas server, you may not be able to view the output file on the remote machine. In this case, Arthas also supports automatically redirecting the output to the local cache file. Examples are as follows:
View hierarchy, urls and classes-loading info for the class-loaders.
View hierarchy, urls and classes-loading info for the class-loaders.
`classloader` can search and print out the URLs for a specified resource from one particular classloader. It is quite handy when analyze`ResourceNotFoundException`.
`classloader` can search and print out the URLs for a specified resource from one particular classloader. It is quite handy when analyzing`ResourceNotFoundException`.
* [reset](reset.md) - reset enhanced classes. All enhanced classes will be reset to their original states. When Arthas server closes, all these enhanced classes will be reset too
* [reset](reset.md) - resets enhanced classes. All enhanced classes will be reset to their original states. When Arthas server closes, all these enhanced classes will be reset too
* version - print out Arthas's version
* version - prints out Arthas's version
* history - view command history
* history - view command history
* quit - exit the current Arthas client without affecting other clients
* quit - exit the current Arthas client without affecting other clients
* stop - terminate the Arthas server, all the Arthas clients connecting to this server will be disconnected
* stop - terminates the Arthas server, all the Arthas clients connecting to this server will be disconnected
* [keymap](keymap.md) - list all Arthas keyboard shortcuts and shortcut customizations.
* [keymap](keymap.md) - lists all Arthas keyboard shortcuts and shortcut customizations.