When I start Apache Tomcat
start
tomcat/bin/startup.bat
tomcat/bin/startup.sh
stop
tomcat/bin/shutdown.bat
tomcat/bin/shutdown.sh
1. What is different between *.sh and *.bat and *.exe file?
So I know file follow that is like a program.
- *bat, *cmd - Batch, Comand
- *exe - C
- *jar - Java
I can read, understand script content in the *bat file.
2. Why don't use *exe instead *sh, *bat file to run ?
3. How the structure is in *bat, *sh, *exe file ?
Best Answer
A
.bat
file is a windows batch file it contains a sequence of windows/dos commands. These cannot be used in a Unix shell prompt.A
.sh
file is a unix shell script it contains a series of unix commands. These cannot be ran in a Windows DOS or Powershell prompt.An
.exe
is windows-only executable format, which may in-turn execute a.bat
script or other compiled code. Also cannot be directly used in a Unix prompt.Each can easily launch a series of commands, or a single command that requires complex environment variables or arguments. You can open a .bat file or the .sh file in a text editor like notepad and view the commands they're running.