How to read a .war file?

Clash Royale CLAN TAG#URR8PPP
I am trying to view the content of a .war file. I first did set its permissions with chmod 777 then when I try to accces it using:
cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
It is giving cd: /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/: Not a directory and I am not able to proceed further.
Can someone help me in this issue?
files compression
add a comment |
I am trying to view the content of a .war file. I first did set its permissions with chmod 777 then when I try to accces it using:
cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
It is giving cd: /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/: Not a directory and I am not able to proceed further.
Can someone help me in this issue?
files compression
5
Don't usechmod 777on a compressed file. You don't need execution bit for reading it. A safe644or640is recommended.
– Braiam
Jul 23 '13 at 11:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
Is/usr/local/standalone/deployments/Sample.wara directory or a file ?
– jlliagre
Jul 23 '13 at 14:16
add a comment |
I am trying to view the content of a .war file. I first did set its permissions with chmod 777 then when I try to accces it using:
cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
It is giving cd: /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/: Not a directory and I am not able to proceed further.
Can someone help me in this issue?
files compression
I am trying to view the content of a .war file. I first did set its permissions with chmod 777 then when I try to accces it using:
cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
It is giving cd: /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/: Not a directory and I am not able to proceed further.
Can someone help me in this issue?
files compression
files compression
edited Jul 23 '13 at 11:41
Braiam
23.7k2077142
23.7k2077142
asked Jul 23 '13 at 11:22
user1660325user1660325
171115
171115
5
Don't usechmod 777on a compressed file. You don't need execution bit for reading it. A safe644or640is recommended.
– Braiam
Jul 23 '13 at 11:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
Is/usr/local/standalone/deployments/Sample.wara directory or a file ?
– jlliagre
Jul 23 '13 at 14:16
add a comment |
5
Don't usechmod 777on a compressed file. You don't need execution bit for reading it. A safe644or640is recommended.
– Braiam
Jul 23 '13 at 11:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
Is/usr/local/standalone/deployments/Sample.wara directory or a file ?
– jlliagre
Jul 23 '13 at 14:16
5
5
Don't use
chmod 777 on a compressed file. You don't need execution bit for reading it. A safe 644 or 640 is recommended.– Braiam
Jul 23 '13 at 11:31
Don't use
chmod 777 on a compressed file. You don't need execution bit for reading it. A safe 644 or 640 is recommended.– Braiam
Jul 23 '13 at 11:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
Is
/usr/local/standalone/deployments/Sample.war a directory or a file ?– jlliagre
Jul 23 '13 at 14:16
Is
/usr/local/standalone/deployments/Sample.war a directory or a file ?– jlliagre
Jul 23 '13 at 14:16
add a comment |
6 Answers
6
active
oldest
votes
.war files are packed. You can extract the information by using either of the following commands:
jar -xvf Sample.war
unzip Sample.war
You should then be able to run cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
3
jar -xvf *warwon't work if there is more than one war file in the current directory.tar -xvfzwon't work at all, you are confusing gzipped files and zipped ones.
– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
I think it's better to usejar -tvfand not the proposedjar -xvfway. So files aren't extracted (and contaminate your .) but just listed.
– Dror Cohen
Mar 31 '15 at 9:52
add a comment |
.war files are zipped archives.
You can list what they contain with either
jar tvf Sample.war
or
zipinfo Sample.war
Should you want to see the content of files stored in an archive, you need to first extract it somewhere:
mkdir /tmp/foo
cd /tmp/foo
unzip /usr/local/standalone/deployments/Sample.war
ls -l WEB-INF/classes/
add a comment |
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 packageunzipinstalled.
– Thaoden
Jun 2 '17 at 8:52
add a comment |
First you have to extract the war file jar xvf Sample.war. Then you can cd in to the war file.
add a comment |
Besides extracting them with jar or unzip, you can also use the Midnight Commander (mc) and navigate to these files and press Enter on them as if they were directories.
If this doesn't immediately work, your flavour of mc is not configured to know the .war suffix, but you can still use this feature by typing either
cd Sample.war#uzip
(old mc) or
cd Sample.war/uzip://
(mc in Debian unstable) and pressing Enter. As an added benefit, pressing Escape then Enter (in some terminals, also Alt-Enter but this is not portable so don’t depend on it) inserts the current filename into the command line, but you’ll have to press Backspace too because it adds a space, and the #uzip or /uzip:// needs to immediately follow the filename.
This is known as the mc VFS (virtual filesystem).
I won’t repeat the unzip/fastjar/jar answers here, but they’re also correct.
add a comment |
If the unix commands does not work, ftp the file to local machine.
.jar or .war or .ear any archive file can be opened in 7-Zip by following the steps below -
- Right click the archive file
- 7-Zip
- Open archive
You should be able to see all the archive file contents. Now browse through the folder/file and then right click -> edit the file -> save the file.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f84093%2fhow-to-read-a-war-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
.war files are packed. You can extract the information by using either of the following commands:
jar -xvf Sample.war
unzip Sample.war
You should then be able to run cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
3
jar -xvf *warwon't work if there is more than one war file in the current directory.tar -xvfzwon't work at all, you are confusing gzipped files and zipped ones.
– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
I think it's better to usejar -tvfand not the proposedjar -xvfway. So files aren't extracted (and contaminate your .) but just listed.
– Dror Cohen
Mar 31 '15 at 9:52
add a comment |
.war files are packed. You can extract the information by using either of the following commands:
jar -xvf Sample.war
unzip Sample.war
You should then be able to run cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
3
jar -xvf *warwon't work if there is more than one war file in the current directory.tar -xvfzwon't work at all, you are confusing gzipped files and zipped ones.
– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
I think it's better to usejar -tvfand not the proposedjar -xvfway. So files aren't extracted (and contaminate your .) but just listed.
– Dror Cohen
Mar 31 '15 at 9:52
add a comment |
.war files are packed. You can extract the information by using either of the following commands:
jar -xvf Sample.war
unzip Sample.war
You should then be able to run cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
.war files are packed. You can extract the information by using either of the following commands:
jar -xvf Sample.war
unzip Sample.war
You should then be able to run cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/
edited Jul 23 '13 at 14:46
answered Jul 23 '13 at 12:08
JZeollaJZeolla
615412
615412
3
jar -xvf *warwon't work if there is more than one war file in the current directory.tar -xvfzwon't work at all, you are confusing gzipped files and zipped ones.
– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
I think it's better to usejar -tvfand not the proposedjar -xvfway. So files aren't extracted (and contaminate your .) but just listed.
– Dror Cohen
Mar 31 '15 at 9:52
add a comment |
3
jar -xvf *warwon't work if there is more than one war file in the current directory.tar -xvfzwon't work at all, you are confusing gzipped files and zipped ones.
– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
I think it's better to usejar -tvfand not the proposedjar -xvfway. So files aren't extracted (and contaminate your .) but just listed.
– Dror Cohen
Mar 31 '15 at 9:52
3
3
jar -xvf *war won't work if there is more than one war file in the current directory. tar -xvfz won't work at all, you are confusing gzipped files and zipped ones.– jlliagre
Jul 23 '13 at 14:14
jar -xvf *war won't work if there is more than one war file in the current directory. tar -xvfz won't work at all, you are confusing gzipped files and zipped ones.– jlliagre
Jul 23 '13 at 14:14
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
This is true, I didn't mean to infer that it would work with multiple wars, just that you could use that command verbatim for any one war. I've changed it
– JZeolla
Jul 23 '13 at 14:48
1
1
I think it's better to use
jar -tvf and not the proposed jar -xvf way. So files aren't extracted (and contaminate your .) but just listed.– Dror Cohen
Mar 31 '15 at 9:52
I think it's better to use
jar -tvf and not the proposed jar -xvf way. So files aren't extracted (and contaminate your .) but just listed.– Dror Cohen
Mar 31 '15 at 9:52
add a comment |
.war files are zipped archives.
You can list what they contain with either
jar tvf Sample.war
or
zipinfo Sample.war
Should you want to see the content of files stored in an archive, you need to first extract it somewhere:
mkdir /tmp/foo
cd /tmp/foo
unzip /usr/local/standalone/deployments/Sample.war
ls -l WEB-INF/classes/
add a comment |
.war files are zipped archives.
You can list what they contain with either
jar tvf Sample.war
or
zipinfo Sample.war
Should you want to see the content of files stored in an archive, you need to first extract it somewhere:
mkdir /tmp/foo
cd /tmp/foo
unzip /usr/local/standalone/deployments/Sample.war
ls -l WEB-INF/classes/
add a comment |
.war files are zipped archives.
You can list what they contain with either
jar tvf Sample.war
or
zipinfo Sample.war
Should you want to see the content of files stored in an archive, you need to first extract it somewhere:
mkdir /tmp/foo
cd /tmp/foo
unzip /usr/local/standalone/deployments/Sample.war
ls -l WEB-INF/classes/
.war files are zipped archives.
You can list what they contain with either
jar tvf Sample.war
or
zipinfo Sample.war
Should you want to see the content of files stored in an archive, you need to first extract it somewhere:
mkdir /tmp/foo
cd /tmp/foo
unzip /usr/local/standalone/deployments/Sample.war
ls -l WEB-INF/classes/
edited Jul 23 '13 at 14:16
answered Jul 23 '13 at 14:06
jlliagrejlliagre
47.7k785137
47.7k785137
add a comment |
add a comment |
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 packageunzipinstalled.
– Thaoden
Jun 2 '17 at 8:52
add a comment |
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 packageunzipinstalled.
– Thaoden
Jun 2 '17 at 8:52
add a comment |
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.
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.
answered May 6 '15 at 13:54
Martin AgfjordMartin Agfjord
211
211
For this to work, you need the packageunzipinstalled.
– Thaoden
Jun 2 '17 at 8:52
add a comment |
For this to work, you need the packageunzipinstalled.
– Thaoden
Jun 2 '17 at 8:52
For this to work, you need the package
unzip installed.– Thaoden
Jun 2 '17 at 8:52
For this to work, you need the package
unzip installed.– Thaoden
Jun 2 '17 at 8:52
add a comment |
First you have to extract the war file jar xvf Sample.war. Then you can cd in to the war file.
add a comment |
First you have to extract the war file jar xvf Sample.war. Then you can cd in to the war file.
add a comment |
First you have to extract the war file jar xvf Sample.war. Then you can cd in to the war file.
First you have to extract the war file jar xvf Sample.war. Then you can cd in to the war file.
answered Jul 23 '13 at 11:24
Manula WaidyanathaManula Waidyanatha
1,7031011
1,7031011
add a comment |
add a comment |
Besides extracting them with jar or unzip, you can also use the Midnight Commander (mc) and navigate to these files and press Enter on them as if they were directories.
If this doesn't immediately work, your flavour of mc is not configured to know the .war suffix, but you can still use this feature by typing either
cd Sample.war#uzip
(old mc) or
cd Sample.war/uzip://
(mc in Debian unstable) and pressing Enter. As an added benefit, pressing Escape then Enter (in some terminals, also Alt-Enter but this is not portable so don’t depend on it) inserts the current filename into the command line, but you’ll have to press Backspace too because it adds a space, and the #uzip or /uzip:// needs to immediately follow the filename.
This is known as the mc VFS (virtual filesystem).
I won’t repeat the unzip/fastjar/jar answers here, but they’re also correct.
add a comment |
Besides extracting them with jar or unzip, you can also use the Midnight Commander (mc) and navigate to these files and press Enter on them as if they were directories.
If this doesn't immediately work, your flavour of mc is not configured to know the .war suffix, but you can still use this feature by typing either
cd Sample.war#uzip
(old mc) or
cd Sample.war/uzip://
(mc in Debian unstable) and pressing Enter. As an added benefit, pressing Escape then Enter (in some terminals, also Alt-Enter but this is not portable so don’t depend on it) inserts the current filename into the command line, but you’ll have to press Backspace too because it adds a space, and the #uzip or /uzip:// needs to immediately follow the filename.
This is known as the mc VFS (virtual filesystem).
I won’t repeat the unzip/fastjar/jar answers here, but they’re also correct.
add a comment |
Besides extracting them with jar or unzip, you can also use the Midnight Commander (mc) and navigate to these files and press Enter on them as if they were directories.
If this doesn't immediately work, your flavour of mc is not configured to know the .war suffix, but you can still use this feature by typing either
cd Sample.war#uzip
(old mc) or
cd Sample.war/uzip://
(mc in Debian unstable) and pressing Enter. As an added benefit, pressing Escape then Enter (in some terminals, also Alt-Enter but this is not portable so don’t depend on it) inserts the current filename into the command line, but you’ll have to press Backspace too because it adds a space, and the #uzip or /uzip:// needs to immediately follow the filename.
This is known as the mc VFS (virtual filesystem).
I won’t repeat the unzip/fastjar/jar answers here, but they’re also correct.
Besides extracting them with jar or unzip, you can also use the Midnight Commander (mc) and navigate to these files and press Enter on them as if they were directories.
If this doesn't immediately work, your flavour of mc is not configured to know the .war suffix, but you can still use this feature by typing either
cd Sample.war#uzip
(old mc) or
cd Sample.war/uzip://
(mc in Debian unstable) and pressing Enter. As an added benefit, pressing Escape then Enter (in some terminals, also Alt-Enter but this is not portable so don’t depend on it) inserts the current filename into the command line, but you’ll have to press Backspace too because it adds a space, and the #uzip or /uzip:// needs to immediately follow the filename.
This is known as the mc VFS (virtual filesystem).
I won’t repeat the unzip/fastjar/jar answers here, but they’re also correct.
answered Jul 24 '13 at 16:00
mirabilosmirabilos
1,228927
1,228927
add a comment |
add a comment |
If the unix commands does not work, ftp the file to local machine.
.jar or .war or .ear any archive file can be opened in 7-Zip by following the steps below -
- Right click the archive file
- 7-Zip
- Open archive
You should be able to see all the archive file contents. Now browse through the folder/file and then right click -> edit the file -> save the file.
add a comment |
If the unix commands does not work, ftp the file to local machine.
.jar or .war or .ear any archive file can be opened in 7-Zip by following the steps below -
- Right click the archive file
- 7-Zip
- Open archive
You should be able to see all the archive file contents. Now browse through the folder/file and then right click -> edit the file -> save the file.
add a comment |
If the unix commands does not work, ftp the file to local machine.
.jar or .war or .ear any archive file can be opened in 7-Zip by following the steps below -
- Right click the archive file
- 7-Zip
- Open archive
You should be able to see all the archive file contents. Now browse through the folder/file and then right click -> edit the file -> save the file.
If the unix commands does not work, ftp the file to local machine.
.jar or .war or .ear any archive file can be opened in 7-Zip by following the steps below -
- Right click the archive file
- 7-Zip
- Open archive
You should be able to see all the archive file contents. Now browse through the folder/file and then right click -> edit the file -> save the file.
answered Feb 21 at 15:45
Arunchunai vendan PugalenthiArunchunai vendan Pugalenthi
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f84093%2fhow-to-read-a-war-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
5
Don't use
chmod 777on a compressed file. You don't need execution bit for reading it. A safe644or640is recommended.– Braiam
Jul 23 '13 at 11:31
See the official Java docs: docs.oracle.com/javase/tutorial/deployment/jar/view.html
– slm♦
Jul 23 '13 at 13:31
Is
/usr/local/standalone/deployments/Sample.wara directory or a file ?– jlliagre
Jul 23 '13 at 14:16