Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-01-2013, 12:52 PM   #1
LQ Newbie
Registered: Nov 2013
Posts: 5

Rep: Reputation: Disabled

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, 01:58 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,667

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

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

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

Original Poster
Rep: Reputation: Disabled
Thank you!


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 02:30 AM
Slax with SquashFS-4 new compression algorithm and layered compression ratios? lincaptainhenryjbrown Linux - Software 2 06-19-2009 06:29 PM
Compression une Linux - General 7 12-27-2007 05:20 PM
About compression on CD s26c.sayan Linux - Newbie 2 04-18-2007 05:27 PM
best compression drigz Linux - Software 2 06-05-2004 08:38 AM

All times are GMT -5. The time now is 09:39 AM.

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