1, Linux system has many commands, regardless of tomcat,nginx,docker and other applications deployed to the Linux server. Regardless of the start, stop, view log or kill process to the corresponding directory or through the pipe symbol splicing command to achieve the effect. This is time consuming and requires remembering a lot of commands. Here's how to encapsulate some simple and easy-to-remember commands
2. First enter the Tomcat directory
Create the folder, put the script command in the folder, note the script command to give permissions, I generally directly chmod 777 iread.sh, that is, give the file all permissions. Here I am in the server above the main encapsulation of some engineering restart, stop, view the log command
3. Then go to the User directory and locate the. bash_profile file if you do not create one yourself.
This file is usually made into a hidden file because it is generally not necessary to change it. At the same time, after writing, you need to execute the source. Bash_profile command, let the command take effect, and then you can execute your packaged commands under the SNS user.
Linux Command Encapsulation notes