Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux command for extracting war file?

Tags:

java

linux

war

How can I extract a .war file with Linux command prompt?

like image 415
ammar Avatar asked Sep 30 '10 18:09

ammar


People also ask

How do I unzip a WAR file in Linux?

A war file is just a zip file with a specific directory structure. So you can use unzip or the jar tool for unzipping.

How do I extract a WAR file?

WAR file is just a JAR file, to extract it, just issue following jar command – “ jar -xvf yourWARfileName. war “.

How do I view the contents of a WAR file in Linux?

If you don't want to extract the file you can use vim filename. war to read the contents of the file. You can read subdirectories of files by selecting them and pressing enter. For this to work, you need the package unzip installed.

How do you extract a file in Linux?

To unzip files, open File Manager, as explained in the Zipping Files via GUI section. Right click the ZIP package you'd like to extract, and select Extract Here, as shown below. Once you click Extract Here, Linux will extract all files in the ZIP package in the working directory.


1 Answers

Using unzip

unzip -c whatever.war META-INF/MANIFEST.MF   

It will print the output in terminal.

And for extracting all the files,

 unzip whatever.war 

Using jar

jar xvf test.war 

Note! The jar command will extract war contents to current directory. Not to a subdirectory (like Tomcat does).

like image 66
jmj Avatar answered Sep 30 '22 09:09

jmj