Results 1 to 6 of 6
-
05-04-2015, 01:11 PM #1Web Hosting Evangelist
- Join Date
- Jul 2013
- Posts
- 463
How to compress a directory via ssh (Ubuntu 14.04)...???
Hello.. i want to compress a directory which has folders..subfolders and files in Ubuntu 14.04.. how i can do this..???
-
05-04-2015, 01:24 PM #2Web Hosting Master
- Join Date
- Apr 2009
- Location
- inside wht
- Posts
- 746
Try tar commad
# tar -czf foo.tgz foo/
or use the zip command
# zip -r foo foo24x7 PROACTIVE SERVER MANAGEMENT | OUTSOURCED WEB HOSTING SUPPORT
Sales : sales @ syslint.com | Call us : (+91)9447607799 | Are you looking for DevOps Admins ?
-
05-05-2015, 10:43 AM #3Web Hosting Master
- Join Date
- Oct 2007
- Posts
- 2,349
Hi,
It depends on what level of compression you want.
Only Tar, use " tar -cvf file.tar file "
Gzip with tar, use " tar -zcvf file.tar.gz file "
For more compression, use " bzip2 -c file > file.bz2 "www.24x7servermanagement.com
Server Management, Server Security, Server Monitoring.
India's Leading Managed Service Provider !! Skype: techs24x7
-
05-05-2015, 05:08 PM #4Web Hosting Guru
- Join Date
- Apr 2014
- Posts
- 264
-
05-06-2015, 06:12 AM #5Junior Guru Wannabe
- Join Date
- Mar 2015
- Posts
- 36
Hello,
You can do it in many ways:
1. Using tar command
tar -cvf filename.tar filename
It will archive the directory and sub-directories(sub folders ) inside it
2. You can compress the archived files using gzip & bzip2
with gzip
gzip filename.tar It will compress the archived directory to 50-60% of its actual size ( the file extension will be like this after compressing filename.tar.gz)
with bzip2
bzip2 filename.tar It will compress the archived directory to 70-80% of its actual size ( the file extension will be like this after compressing filename.tar.bz2)
Also insted of doing archive and compression separately. You can use it in a single step
tar -czvf filename.tar ( for gzip)
tar -cjvf filename.tar ( for bzip2)
You can use gunzip & bunzip2 to uncompressing the files
ie gunzip filename.tar.gz
bunzip2 filename.tar.bz2
Hope this helps you.
Thanks,
JaijoLast edited by jaijop; 05-06-2015 at 06:15 AM. Reason: spell change
-
05-06-2015, 08:48 AM #6Temporarily Suspended
- Join Date
- May 2015
- Posts
- 4
open folder ( cd /home/..../folder , and tar -zcvf file.tar.gz file , ) , for download file wget website/file.tar.gz.
Similar Threads
-
How to copy large directory via SSH?
By LP560 in forum Hosting Security and TechnologyReplies: 11Last Post: 07-15-2009, 02:13 AM -
How to move a file via ssh ?
By chengaz in forum Hosting Security and TechnologyReplies: 12Last Post: 08-08-2008, 10:03 AM -
how to rename a folder via SSH ?
By WWWhost in forum Hosting Security and TechnologyReplies: 3Last Post: 02-24-2005, 07:25 AM -
How to PROPERLY restart services via ssh
By Enduro-Maaaan in forum Hosting Security and TechnologyReplies: 4Last Post: 07-06-2004, 10:34 AM -
How to change (Keyboard) Language via SSH ?
By JapAniManga.ch in forum Web Hosting LoungeReplies: 1Last Post: 08-26-2003, 04:37 PM