A new article on Linux-Summary of Common commands and shortcuts, a new article on linux
Recently, I have been familiar with Linux and compiled some common commands and shortcut keys.
Tab completion command
When the command cannot be remembered, you can use the tabs of the first few words that you remember to enter to automatically complete the command.
Start tomcat with $ startup. sh
Stop the tomcat service through $ shtdown. sh. Please note that the $ symbol is generally existing and only requires the command line following $.
View port usage status netstat-anp | grep 8080, netstat-anp | grep 8443,8080, and 8443 are port numbers. When the status is shown in
It indicates that the service is occupied by the web service. If it is used by other programs, it is occupied by other programs. if the service is stopped, kill 10679 can be used to kill the service.
When you want to edit a file, use vi server. xml to edit the server. xml files, sometimes invisible file content, with cat server. xml, you can see the file content,
Of course, vi has options such as viewing (o) and editing (e). If cat does not exist, you can use (I) to insert data from the current row. (o) insert data from the next row.
When I enter the editing mode, I cannot return it. This is the biggest problem I encountered at the beginning. Later I asked someone else. Someone told me that I can exit the editing status with Esc.
Then it is saved or exited. wq is saved and exited. If w exists, it is saved. Only q is exited. If no exit is allowed, q !, In this way, you can.
There is also a delete, rm-rf target file, which is to delete the file and its sub-files under the target file in the current folder, rm-rf/target file is to delete/sub-files under the target file, in the root directory, rm-rf Level 1 directory/Level 2 /.. /Target folder, which deletes all files in the target folder.
Rm is deleted. Once deleted, it cannot be recovered. Please use it with caution.
-R is recursive down, regardless of the number of levels of directories, delete them together.
-F is a direct force deletion without any prompt.
There is another-I, which is an interactive deletion. If you are worried about accidental deletion, use-I. Every time, a prompt will be displayed. The user enters Y to confirm deletion, and other inputs will not be deleted.
Tip: some of the above commands have spaces in the middle. Be careful when you enter them.
These are just the Linux Study Notes of my colleagues over the past few days.