Messed up tar files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Messed up tar files
# 1  
Old 11-03-2004
Data Messed up tar files

I created tar files for directories using this command:

tar -cvf * >tarfile

what happened was I got a file tarfile with a list of the files and it took the first file in each directory and overwrote it with the actual tar file. I've been trying to figure out since yesterday what I did wrong. Can someone help me please. And is there anyway to get those files back that were overwritten - they don't appear to be in the tar file - so probably not.

And I know I did something stupid just not sure what - so feel free to be brutal.
# 2  
Old 11-03-2004
uff!

the command should have been

tar -cvf tarfile .

when you specify tar with -f option, the first argument should be the archive file name!!

tar -cvf <archive file name> <directories to be archived>

In your case the '*' expanded into list of all files in the current directory. So the first file became archive file and you lost this file.

But I'm not so sure why it overwrote other first files in each directory. It shouldn't have been.
# 3  
Old 11-03-2004
Thank you for the fast response A4.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

2. Shell Programming and Scripting

BASH scripting - Preventing wget messed downloaded files

hello. How can I detect within script, that the downloaded file had not a correct size. linux:~ # wget --limit-rate=20k --ignore-length -O /Software_Downloaded/MULTIMEDIA_ADDON/skype-4.1.0.20-suse.i586.rpm ... (6 Replies)
Discussion started by: jcdole
6 Replies

3. Ubuntu

Messed up password

I am unable to change my password even in root (recovery mode), or to unlock it. I can still access my account, but without password protection. In GUI Administrator account 'disabled' is displayed. This is what I have done so far: In root:#usermod -U roy usermod:cannot lock /etc/passwd;... (9 Replies)
Discussion started by: Royalist
9 Replies

4. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

5. UNIX for Dummies Questions & Answers

messed up path

Help!! Seem to have messed up my path, as I keep getting command not found error. Could someone please tell whats wrong or how to fix it. export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:$PATH ---------- Post updated at 08:34 PM ---------- Previous update was at 07:50 PM ---------- ... (1 Reply)
Discussion started by: davcra
1 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. AIX

Totally messed up

I have moved the etc/passwd file and we are now unable to get in to Unix - any suggestions? (2 Replies)
Discussion started by: vbagwell
2 Replies

8. UNIX for Advanced & Expert Users

How to create a Tar of multiple Files in Unix and FTP the tar to Windows.

Hi, On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files. a) /usr/users/oracle/bin b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies

9. Shell Programming and Scripting

I think I have messed up with crontab

Hi Guy, In my system there were some cronjob were already scheduled. and somehow I want to enter one new cronjob with crontab. So I isssue crontab temp.txt. it scheduled that job but now it's showing me only this job with crontab -l. but I can not see the old cronjob list that already set up.... (2 Replies)
Discussion started by: vishalpatel03
2 Replies

10. UNIX for Advanced & Expert Users

Untaring *.tar.tar files

Hi all, How to untar a file with .tar.tar extension. A utility that i downloaded from net had this extension. Thanks in advance, bubeshj. (6 Replies)
Discussion started by: bubeshj
6 Replies
Login or Register to Ask a Question