Creating a shell script to compress files using Cygwin

-1

I've got a minor project wherein I'm to create a few shell scripts in Windows and run them through Cygwin for Linux files. At least that's how it was described to me. Any suggestions would be great.

user362784

Posted 2014-08-29T03:34:03.873

Reputation: 1

Question was closed 2014-09-18T09:16:58.733

What have you tried? Where are you stuck? (man tar)

– gronostaj – 2014-09-16T16:11:54.097

Answers

0

A good way to do it is using gzip to compress files.

If you need to package multiple files up into one big one, try looking into tar, then gzip them after you do that.

It sounds like an assignment so that should put you in the right direction.

Jeff Clayton

Posted 2014-08-29T03:34:03.873

Reputation: 918

Thanks. I think I'm supposed to use Cygwin. At least that's what I was advised to download today. – user362784 – 2014-08-29T03:58:48.813

CygWin includes tar and gzip if you choose it to, you tell it which parts to download ;) – Jeff Clayton – 2014-08-29T04:00:26.543

That sounds great! Appreciate it. – user362784 – 2014-08-29T04:05:08.183

If it wasn't explained to you well enough, CygWin is 'Linix/Unix Commands For Windows' in a pre-built package with addons. Glad to help! – Jeff Clayton – 2014-08-29T04:06:18.837

Yeah, this was sort of a "I want you to write some shell scripts to compress and move files. Download Cygwin as part of the exercise." type of assignment. – user362784 – 2014-08-29T04:07:41.370

It is an amazing compilation. – Jeff Clayton – 2014-08-29T04:08:44.093

tar has the capability to compress by itself... use the holy man! IT's the help. man tar and you can read a lot about the command and discover other, slightly better' compression method. E.g. bzip2. – Hastur – 2014-08-29T06:18:54.493

It does but if you have worked with Linux distros for any amount of time you will find out that the generally accepted method is precisely what I prescribed. Tar + gzip consolidated to .tgz -- Bzip2 is another one yes. Same thing. This was forward thinking help not unilateral. – Jeff Clayton – 2014-08-29T11:20:58.233

@Hastur has a very good point and you will find that Unix/Linux offers many ways to reach the same goals. – Jeff Clayton – 2014-08-29T11:29:17.593