Create Tar files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Create Tar files
# 1  
Old 06-27-2014
Create Tar files

Hi,

the folder /home/nandy/test will have two files called
notepad1
nodepad2

when i issued
Code:
 
/home/nandy/test> tar -cvf componse.tar ./notepad1 ./notepad2

and no error
Code:
 
/home/nandy/test> tar -cvf    nan.tar    .

--> this creates nan.tar with the below message

nan.tar same as archive file, not archived



The second question is

when i want to extract the file in other directory or subdirectory .. i have issued the below command
Code:
 home/nandy/test/sub_test> tar -xvf /home/nandy/test/compose.tar

i am getting error message and files not extraced.
Code:
 
home/nandy/test/sub_test> tar -xvf /home/nandy/test/compose.tar

I get:
File home/nandy/test/sub_test not present in the archive.

please clarify.

Last edited by vbe; 06-27-2014 at 02:12 PM.. Reason: code tags
# 2  
Old 06-27-2014
Quote:
/home/nandy/test> tar -cvf nan.tar . --> this creates nan.tar with the below message

nan.tar same as archive file, not archived
What it means is tar fell on the file when parsing . called nan.tar which is the archive file name you gave for tar...

I let you work out the rest now...
 
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. UNIX for Dummies Questions & Answers

Create Tar and GZip files under Unix

Hi All I have 2 tar files and inside a Gzip file (actually its folder) that i got from a Unix user to check the code for him and find some problem. I decompress the Tar file and use 7-ZIP to open the Gzip file and Extract all folders and files. I found the code problem and change it but now when... (1 Reply)
Discussion started by: giladboker
1 Replies

3. Shell Programming and Scripting

Create tar file

Following are the list of files available in the dataout directory a1.txt.gz a2.txt.gz b3.txt.gzStep 1: now the tar file needs to be created as follows. tar -cvf ab.tar *.gzAll the files with extn .gzg has to be bundled in the tar file. Once the tar file is created, the files which are... (9 Replies)
Discussion started by: kmanivan82
9 Replies

4. UNIX for Dummies Questions & Answers

How to create rpm from tar.gz?

I m planning to use puppet to implement organizational linux hardening policies across the linux servers. To begin with i have downloaded. puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet. Now i want to roll out the puppet but before that i would like to make... (7 Replies)
Discussion started by: pinga123
7 Replies

5. 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

6. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

7. Solaris

Find files older than x days and create a consolidated single tar file.

Hello, I need help in finding files older than x days and creating a single consolidated tar file combining them. Can anyone please provide me a script? Thanks, Dawn (3 Replies)
Discussion started by: Dawn Bosch
3 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. HP-UX

tar says: cannot create

Hello, I'm quite new to HP-UX and I stumbeled upon some strange behaviour from tar. I have a script like this: find -mtime $days -type f|xargs tar cvf tarfile.tar and it make me a tar file with files that has been changed in $days. When i run 'tar tf tarfile.tar' it give me output like... (5 Replies)
Discussion started by: oey2000
5 Replies

10. UNIX for Dummies Questions & Answers

Create and pw protect .tar files

Ok here at work I have been charged with finding a way to create a password protect .tar files from the command line. Now i have yet to actully sit down and learn UNIX yet, but that is one of my next todo's. Anyway my questions is I have been surfing in search of a solution and the closest answer... (5 Replies)
Discussion started by: clovell
5 Replies
Login or Register to Ask a Question