Jar/Tar to a diffent folder/same folder w/ filename


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Jar/Tar to a diffent folder/same folder w/ filename
# 1  
Old 03-25-2009
Jar/Tar to a diffent folder/same folder w/ filename

Hi,

I want to extract myfile.war to a folder which is in the same folder with war file.I did this as normal:

jar -xvf myfile.war

But it exploded all the content of file to the same level folder instead of that I was expecting to create a folder called myfile.

This works with tar:
tar -C available_folder -xvf a_tar_file.tar
but not with jar:
tar -C available_folder -xvf a_tar_file.tar
and it prints "Illegal option: C" even C is available in its man pages.

Another thing is the method works with tar archive needs to create a folder before doing. But is there any other command that I can also create a folder while extracting tar file? Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. UNIX for Dummies Questions & Answers

How to find a filename of a folder?

Hi, Please help me i have a file directory in .txt. inside this directory is a list of names of folders to find inside in a folder. to make more easy to understand below is my list inside .txt: foldernameA foldernameB foldernameC I need to check if those folder names are inside... (1 Reply)
Discussion started by: cmarzan
1 Replies

3. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

4. Shell Programming and Scripting

Compare filename to file folder

Hi. I have a problem, could you help me ? Situation: there are alot of files in directory_1, with the names like "notneeded1blabla.bla", "notveryneededblabla.gla". there is directory_2 that has directories with names like that: "bla_needed1", "blab_veryneeded". What i need so much is to place... (7 Replies)
Discussion started by: sw_and
7 Replies

5. Shell Programming and Scripting

Find and Tar a Folder

Hi all, I have created a function that looks for a folder in a particular directory, checks the date it was last modified and if its old then compress it. This works fine for files using gzip. However for folders I had to use tar. This is my function: compressOldFolder() { # $1 is... (10 Replies)
Discussion started by: TasosARISFC
10 Replies

6. UNIX for Dummies Questions & Answers

Tar-ing folders in a folder

How do I create individual tars of a all the directories in a directory? I have a directory called 'patients', each patient has a directory in the patients directory. I want to create tars such that each patient has their own tar file. Thanks! (5 Replies)
Discussion started by: HappyPhysicist
5 Replies

7. UNIX for Dummies Questions & Answers

tar file from current folder

Hello guys, I am sure this has been asked before, but honestly, I cant find post talking about it. Here is what I need: - A tar file will be generated manually by user - This tar file is then used within a bash shell script My source folder structure is like this: ... (2 Replies)
Discussion started by: manolain
2 Replies

8. Solaris

jar from a different folder

Hi , i use below command to create a jar from /home/surya jar -cvf foldername.jar jarfolderpath foldrename.jar= directorywhere jar file needs to be created including jar file name jarfolderpath: directory which needs to be included to create a jar Now taking below scenario:... (1 Reply)
Discussion started by: surya.jena
1 Replies

9. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

10. Solaris

extract tar.gz under a specific folder

Hi, How to extract a tar.gz file and put it under a designated folder that I specify in a one line command? thank you in advance. (3 Replies)
Discussion started by: melanie_pfefer
3 Replies
Login or Register to Ask a Question
RMF(1)								     [nmh-1.5]								    RMF(1)

NAME
rmf - remove an nmh folder SYNOPSIS
rmf [+folder] [-interactive | -nointeractive] [-version] [-help] DESCRIPTION
Rmf removes all of the messages (files) within the specified (or default) folder, and then removes the folder (directory) itself. If there are any files within the folder which are not a part of nmh, they will not be removed, and an error will be produced. If the folder is given explicitly or the -nointeractive option is given, then the folder will be removed without confirmation. Otherwise, the user will be asked for confirmation. If rmf can't find the current folder, for some reason, the folder to be removed defaults to `+inbox' (unless overridden by user's profile entry "Inbox") with confirmation. If the folder being removed is a subfolder, the parent folder will become the new current folder, and rmf will produce a message telling the user this has happened. This provides an easy mechanism for selecting a set of messages, operating on the list, then removing the list and returning to the current folder from which the list was extracted. If rmf s used on a read-only folder, it will delete all the (private) sequences (i.e., "atr-seq-folder" entries) for this folder from your context without affecting the folder itself. Rmf irreversibly deletes messages that don't have other links, so use it with caution. FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder Inbox: To find the default inbox SEE ALSO
rmm(1) DEFAULTS
`+folder' defaults to the current folder, usually with confirmation `-interactive' if +folder' not given, `-nointeractive' otherwise CONTEXT
Rmf will set the current folder to the parent folder if a subfolder is removed; or if the current folder is removed, it will make "inbox" current. Otherwise, it doesn't change the current folder or message. BUGS
Although intuitively one would suspect that rmf works recursively, it does not. Hence if you have a sub-folder within a folder, in order to rmf the parent, you must first rmf each of the children. MH.6.8 11 June 2012 RMF(1)