LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2013, 11:52 AM   #1
CJennings87
LQ Newbie
 
Registered: Nov 2013
Posts: 5

Rep: Reputation: Disabled
Compression


I need some help figuring out my mistakes. I know I am close, but I am getting confused. Any help is much appreciated

Compress the symbolic link /root/sfile using the compress utility and display the compression ratio4

# bzip2 –v /root/sfile unsure because it is a symbolic link


Compress the contents of the directory /root/dir1 using the gzip utility and display the compression ratio

# gzip –v /root/dir1 unsure because it is a directory (-r for directory, but -v to show compression ratios)


Decompress the file /root/letter.bz2

# uncompress –v /root/letter.bz2
 
Old 12-01-2013, 12:58 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,798

Rep: Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749
You get an error if you try to compress a symlink, so you need to get to the real file:

Code:
REALFILE=$(readlink /root/sfile)
bzip2 -v $REALFILE
You can have multiple options on a command:

Code:
gzip -r -v /root/dir1
 
1 members found this post helpful.
Old 12-02-2013, 04:38 PM   #3
CJennings87
LQ Newbie
 
Registered: Nov 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compression help dimpu Linux - Newbie 10 09-29-2010 01:30 AM
Slax with SquashFS-4 new compression algorithm and layered compression ratios? lincaptainhenryjbrown Linux - Software 2 06-19-2009 05:29 PM
Compression une Linux - General 7 12-27-2007 04:20 PM
About compression on CD s26c.sayan Linux - Newbie 2 04-18-2007 04:27 PM
best compression drigz Linux - Software 2 06-05-2004 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration