zip unix directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users zip unix directory
# 1  
Old 09-11-2008
zip unix directory

what's the best command to zip up the whole unix directory, then ftp this to windows for viewing the directories/files.

thank you
# 2  
Old 09-11-2008
Code:
tar -czf /tmp/mydirectory.tar.gz  mydirectory

-- the z part only works if you have GNU tar. Else:
Code:
tar -cf mydirectory.tar  mydirectory; gzip mydirectory.tar

you then have a compressed tar archive in /tmp named mydirectory.tar.gz. Windows can open it and extract files.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to zip csv files having specific pattern in a directory using UNIX shell script?

I have files in a Linux directory . Some of the file is listed below -rw-rw-r--. 1 roots roots 0 Dec 23 02:17 zzz_123_00000_A_1.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_121_00000_A_2.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_124_00000_A_3.csv drwxrwxr-x. 2 roots roots 6 Dec 23... (4 Replies)
Discussion started by: Balraj
4 Replies

2. Shell Programming and Scripting

Zip a file without directory

Hi I was trying to zip some file in a directory using the below command. find /dir1/dir2/ -name "asdf*.txt" -print | zip -m /dir1/dir2/dir3/asd_Date.zip -@ Its getting zipped.But when I am trying to unzip, Its getting unzipped with full directory structure. Is there any command... (1 Reply)
Discussion started by: ginrkf
1 Replies

3. Shell Programming and Scripting

Zip a directory based on its age

I had allot of help with the below script, and its been a long time since i've done anything with shell scripts so I am having some trouble. I am trying to zip the trace folder after it is copied and dated but i'm unsure of how to tell it to zip this new folder without knowing what it will be... (2 Replies)
Discussion started by: kylecn
2 Replies

4. Shell Programming and Scripting

Command to zip a directory

Hi , How to compress the entire directory . Rajesh (1 Reply)
Discussion started by: guddu_12
1 Replies

5. UNIX for Dummies Questions & Answers

Zip all files in a directory and move to another directory

Hi, need to zip all files in a directory and move to another directory after the zip.. i am using this one but didnt help me... zip -r my_proj_`date +%Y%m%d%H%MS`.zip /path/my_proj mv in_proj_`date +%Y%m%d%H%M%S`.zip /path/source/ i am trying to zip all the files in my_proj... (0 Replies)
Discussion started by: dssyadav
0 Replies

6. UNIX for Dummies Questions & Answers

Zip files inside the directory, but not the directory itself

Hi, Im facing a problem that im stucked, I have the following structure: thales@pereirtc-vbox:/home/VfARM$ ls code config doc lib manifest.bak manifest.rel manifest.v3 ns pub if i try to execute zip -q -o arm.zip VfARM/* it will create a zip file with the folder VfARM.... (2 Replies)
Discussion started by: Thales.Claro
2 Replies

7. Shell Programming and Scripting

Restricting zip to current directory only

I am using the following command in a C shell script: find . -name "*.*" -print | zip $ProjectZipFile -@ to zip files in a Unix (Sun and/or Linux) directory for archiving purposes. This command works fine, the only problem being that if sub-directories are present, they are included in... (5 Replies)
Discussion started by: phudgens
5 Replies

8. UNIX for Dummies Questions & Answers

how to zip the entire directory

my first question is how to zip the entire directory contents. second question is can we unzip the same file through windows environment. please help i need to complete it by EOD (3 Replies)
Discussion started by: bbc17484
3 Replies

9. Shell Programming and Scripting

Zip all files in a directory

I have two files in a directory: xxxx.txt xxxx.csv I need to zip both files up but the command I am doing below is only zipping xxx.txt file????: cd ../$CUSTOMER_DIRECTORY zip -q ${name}${FILE_OUT_NAME}.zip ls -lrt *.csv *.txt can anyone help?:confused: (3 Replies)
Discussion started by: Pablo_beezo
3 Replies

10. Shell Programming and Scripting

assign zip directory to variable

I'm running an sh shell that is unzipping some zip files that have a directory structure on them. Is there a way I can find the top level directory in the zip file and assign that to a variable? mike (5 Replies)
Discussion started by: skwyer
5 Replies
Login or Register to Ask a Question