LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 03: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, 03:12 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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, 03: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 03:19 PM.
 
Old 10-09-2007, 11:40 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797

Rep: Reputation: 282Reputation: 282Reputation: 282
The 'f' in cvzf refers to the output filename, not the input filename.
 
Old 10-10-2007, 03: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 10:33 AM
Easy Question aeuzent Linux - Newbie 2 05-21-2005 08:06 AM
Easy question here the_sLiDe Linux - Software 2 11-08-2004 08:22 AM
easy question ashley75 Linux - General 7 10-15-2003 02:51 PM
easy question Scruff Mandriva 3 08-28-2003 07:34 PM

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

All times are GMT -5. The time now is 09:48 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
Open Source Consulting | Domain Registration