Compressing all directories inside a directory and remove the uncompressed version


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compressing all directories inside a directory and remove the uncompressed version
# 1  
Old 06-29-2012
Compressing all directories inside a directory and remove the uncompressed version

hi
pls give me a script to compress all directories inside a directory and remove the original uncompressed version...

>>
please also tell the single commmand to uncompress all the directories back...whemn needed
# 2  
Old 06-29-2012
you want to Zip a directory or a files inside a directory ?
This User Gave Thanks to expert For This Post:
# 3  
Old 06-29-2012
hi expert
i need to compress all the directories inside a directory to .tar.gz format ...and delete the original uncompressed version of the directory inside the directory.,...
also pls tell the command to uncompress the same..

Last edited by dll_fpga; 06-29-2012 at 05:53 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove directories when specific file is in directory?

Hello :) I need little help i have following cmd: this only able to delete files but not folder which contain that file find /home/test/* -name "*.testfile" -type f -exec rm -i {} \; how to delete whole directory if file called somethingblahblah.testfile is there? Thanks you :) (3 Replies)
Discussion started by: ZerO13
3 Replies

2. Shell Programming and Scripting

How to delete all the files and folders inside all the directories except some specific directory?

hi, i have a requirement to delete all the files from all the directories except some specific directories like archive and log. for example: there are following directories such as A B C D Archive E Log F which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies

3. UNIX for Dummies Questions & Answers

Remove all the subdirectories except latest 5 inside any given directory

I Want to remove all the sub-directories except latest five in any given TGTDIR. Is there a way to do so without making a cd to TGTDIR? I have tried the following but not worked. Thank you. rm -rf `ls -t $TGTDIR | awk 'NR>5'` (20 Replies)
Discussion started by: Devendra Hupri
20 Replies

4. Shell Programming and Scripting

Copy a file from directroy/ prior version to the directory/ new version

How to copy a file from directroy/ prior version to the directory/ new version automatically. (4 Replies)
Discussion started by: roy1912
4 Replies

5. Shell Programming and Scripting

Looping inside directories based on a file which contains file directory list

Hi All, Please help. I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here file1 dir1 dir2 dir3 dir4 file2 dir5 dir6 dir7 dir8 file3 dir9 dir10 dir11 dir12 (6 Replies)
Discussion started by: Piyush Jakra
6 Replies

6. Shell Programming and Scripting

remove a whole directory tree WITH files inside?

Assume I want to remove a whole directory tree beginning with /foo/bar/ The directory or sub-directories may contain files. The top directory /foo/bar/ itself should not be deleted. rm -f- r /foo/bar does not work because it requires a directory tree without files. How does it work... (3 Replies)
Discussion started by: pstein
3 Replies

7. UNIX for Dummies Questions & Answers

Compressing several directories

Could someone help with the easiest command to compress several directories and files? For example, I want two directories: /var/www/logs/ and /var/www/zones/ and this file: /var/www/messages to be compressed by tar/zip to a specific output directory like: /var/www/backup.extension ... (1 Reply)
Discussion started by: holyearth
1 Replies

8. UNIX for Dummies Questions & Answers

Compressing a Directory in UNIX ???

Hi All, I am new to UNIX. I have a small problem to be solved. I have directory where all the log files/list files generated by SAS Program. Q1) Can we compress the folder(Directory) as Windows zipping. Q2) If yes what is the command to be used to achieve the probelm. Q3) If we do... (4 Replies)
Discussion started by: manas6
4 Replies

9. UNIX for Dummies Questions & Answers

compressing a directory

I have a pretty large directory on a backup hard drive. I have Tiger for an OS, what would be the best way to compress this directory. there is a large number of files inside in addition if that makes a difference any help appreciated hopefully thanks in advance (2 Replies)
Discussion started by: cleansing_flame
2 Replies

10. Shell Programming and Scripting

tarring/compressing files in Unix directory

hi guys, i'm totally new with Unix sripting and no idea how to do the scripting at all. My problem is that my boss asked me to do this: 1.) create a script that will tar or gzip the files in particular directory eg: i'm on my home directory and I need to tar/gzip the file in.. assuming... (1 Reply)
Discussion started by: montski
1 Replies
Login or Register to Ask a Question