LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-09-2007, 04:08 PM   #1
christianunix
Member
 
Registered: Oct 2007
Posts: 40

Rep: Reputation: 15
Very easy question.. you will probably laugh


I am trying to compress a file named realmaltese

so I give this command on the command line

Code:
tar cvzf realmaltese
but the above gives me the following message

tar: Cowardly refusing to create an empty archive

what can I do? what am I doing wrong?

thanks
 
Old 10-09-2007, 04:12 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Code:
tar cvzf realmaltese.tar.gz realmaltese
the 'f' wants a file name, and was grabbing the "realmaltese", then there was nothing to put in the archive.
 
Old 10-09-2007, 04:18 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
If you just want to compress a single file, you can just gzip or bzip it (see the man pages for gzip and bzip2, respectively). Edit: oh and please use useful thread titles in future.

Last edited by Nylex; 10-09-2007 at 04:19 PM.
 
Old 10-10-2007, 12:40 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
The 'f' in cvzf refers to the output filename, not the input filename.
 
Old 10-10-2007, 04:19 AM   #5
gejr
Member
 
Registered: Apr 2006
Posts: 53

Rep: Reputation: 15
In other words:

Code:
tar cvzf output-file.tar.gz input-file
or

Code:
tar cvzf output-file.tar.gz *
to take all files in the directory-tree and put them in output-file.tar.gz

Hope this clarified stuff for 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
Have a laugh at my stupid question davidhilbert Linux - Newbie 4 04-29-2006 11:33 AM
Easy Question aeuzent Linux - Newbie 2 05-21-2005 09:06 AM
Easy question here the_sLiDe Linux - Software 2 11-08-2004 09:22 AM
easy question ashley75 Linux - General 7 10-15-2003 03:51 PM
easy question Scruff Mandriva 3 08-28-2003 08:34 PM


All times are GMT -5. The time now is 08:20 PM.

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