Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Zip a folder including its sub-folders. Post 302213524 by gdog on Thursday 10th of July 2008 09:50:24 AM
Old 07-10-2008
Zip a folder including its sub-folders.

Hi,

I have a folder that contains a few sub-folders. I would like to zip that folder and KEEP the subfolders. What it does at the moment is taking all the files within the subfolders and zipping them into one big file (zip -r ...). Does anyone know the UNIX command to keep the subfolders in the zipped files?

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

zip nesting empty folders

I'm using the following command to zip a project file, but when it finishes, the resulting zip file contains all the directories above the file I wanted zipped, myapp.app, each one empty until you get to the actual app. zip -r myapp.app.zip ... (0 Replies)
Discussion started by: groundlevel
0 Replies

2. Windows & DOS: Issues & Discussions

How can I upload a zip folder on a unix path from my windows folder?

Hello, I am an amature at UNIX commands and functionality. Please could you all assist me by replying to my below mentioned querry : How can I upload a zip folder on a unix path from my windows folder? Thanks guys Cheers (2 Replies)
Discussion started by: ajit.yadav83
2 Replies

3. UNIX for Dummies Questions & Answers

Zip command (zip folder doesn't include a folder of the same name)

Hi guys, I have a question about the zip command. Right now I have a directory with some files and folders on it that I want to compress. When I run the zip command: zip foo -r I am getting a foo.zip file that once I unzip it contains a foo folder. I want to create the foo.zip, but that... (1 Reply)
Discussion started by: elioncho
1 Replies

4. UNIX for Dummies Questions & Answers

Create zip without including directories

Hi guys, I'm trying to do the following: zip -r /tmp/foo.zip public/accounts/foo But the zip that's been made has the whole "public/accounts/foo" path. I want only the foo folder to be zipped. How can I do this? Thanks, Elías (2 Replies)
Discussion started by: elioncho
2 Replies

5. Shell Programming and Scripting

Zip all the files including directories - subdirectories

Hi, Is is possible to zip a folder and all its contents within the folder ( including sub-directories and files) into a zip file? and can regain the same structure if unzipped? Thanks (6 Replies)
Discussion started by: rudoraj
6 Replies

6. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

7. Shell Programming and Scripting

Copy Folders and ZIP IT

HI All I have one master folder : ABCXYZ I have sub folder in there : AB XY AZ AC PR AL Now i want to copy AB , PR ,AL in to one new folder and zip it with time stamp. like Pre_02192013_12_32.zip Zip folder should be in master folder. (2 Replies)
Discussion started by: pareshkp
2 Replies

8. Shell Programming and Scripting

How to auto zip all folders?

Hi, How do I write a script that will automatically find and zip any folder to the same name in a directory and affected recursively?. The zip file should be place in the same directory where the source folder is. Help is appreciated. Thanks in advance. ex: Orange Crayon Blue Crayon... (5 Replies)
Discussion started by: Frozen77
5 Replies

9. Shell Programming and Scripting

Gunzip,grep and zip across folders in a subdirectory

I have a simple function that greps within a folder into files that are already gunzipped. This was already written for me so from my understanding fn=$1 specifies that it will look into any file in that folder that is gunzipped and the rest of the script greps the data its looking for and puts it... (3 Replies)
Discussion started by: red56
3 Replies

10. UNIX for Beginners Questions & Answers

Tar.gz/zip folders in a directory with _EBASE string

Hi Folks - Happy Friday and I hope you all are well! What's the easiest way to tar.gz / zip all direct children directories in a folder that have the string _EBASE (suffix)? Thank you! (6 Replies)
Discussion started by: SIMMS7400
6 Replies
folders(1mh)															      folders(1mh)

Name
       folders - list folders and contents

Syntax
       folders [ +folder ] [ msg ] [ options ]

Description
       The command displays the names of your folders and the number of messages that they each contain.

       The  command displays a list of all the folders in your Mail directory.	The folders are sorted alphabetically, each on its own line.  This
       is illustrated in the following example:
	 Folder      # of messages (  range  ); cur  msg  (other files)
	   V2.3  has	3 messages (   1-   3).
	 adrian  has   20 messages (   1-  20); cur=   2.
	  brian  has   16 messages (   1-  16).
	  chris  has   12 messages (   1-  12).
	copylog  has  242 messages (   1- 242); cur= 225.
	  inbox+ has   73 messages (   1- 127); cur= 127.
	    int  has	4 messages (   1-   4); cur=   2  (others).
	   jack  has   17 messages (   1-  17); cur=  17.

		 TOTAL= 387 messages in 8 folders.
       The plus sign (+) after inbox indicates that it is the current folder.  The information about the folder includes the term (others).   This
       indicates  that the folder contains files which are not messages.  These files may be either sub-folders, or files that do not belong under
       the MH file naming scheme.

       The command is identical to the effect of using the -all option to the command.

       If you use with the +folder argument, it will display all the subfolders within the named folder.  as shown in the following example:
       % folders +test
       Folder		# of messages (  range	); cur	msg  (other files)
       test+ has	  18 messages (   1-  18);	     (others).
       test/testone has    1 message  (   1-   1).
       test/testtwo has   no messages.

	      TOTAL=   19 messages in 3 folders.
       See for more details of sub-folders.

Options
       -fast
       -nofast	 Lists only the name of folders, with no additional information.  This is faster because the folders need not be read.

       -help	 Prints a list of the valid options to this command.

       -list
       -nolist	 Lists the contents of the folder-stack.  No +folder argument is allowed with this option.

       -pack
       -nopack	 Re-numbers messages in the folders.  Messages are re-numbered sequentially, and any gaps  in  the  numbering  are  removed.   The
		 default operation is -nopack, which does not change the numbering in the folder.

       -pop	 Discards  the	top of the folder-stack, after setting the current folder to that value.  No +folder argument is allowed with this
		 option.  This corresponds to the operation in the C-shell; see The -push and -pop options are mutually exclusive: the last occur-
		 rence of either one overrides any previous occurrence of the other.

       -push	 Pushes  the  current  folder  onto  the  folder-stack, and makes the +folder argument into the current folder.  If +folder is not
		 given, the current folder and the top of the folder-stack are exchanged.  This corresponds to the operation in the  C-shell;  see
		 The  -push switch and the -pop switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence
		 of the other.

       -recurse
       -norecurse
		 Lists folders recursively.  Information on each folder is displayed, followed by information on any  sub-folders  which  it  con-
		 tains.

       -total
       -nototal  Displays  only the total number of messages and folders in your Mail directory.  This option does not print any information about
		 individual folders.  It can be suppressed using the -nototal option.

       The defaults for are:

	      +folder defaults to all
	      msg defaults to none
	      -nofast
	      -noheader
	      -nototal
	      -nopack
	      -norecurse

Restrictions
       MH does not allow you to have more than 100 folders at any level in your Mail directory.

Profile Components
       Path:		 To determine your MH directory
       Folder-Protect:	 To set protections when creating a new folder
       Folder-Stack:	 To determine the folder stack
       lsproc:		 Program to list the contents of a folder

Files
       The user profile.

See Also
       csh(1), folder(1mh), refile(1mh), mhpath(1mh)

																      folders(1mh)
All times are GMT -4. The time now is 10:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy