how to tar a directory in a sun solaris?


 
Thread Tools Search this Thread
Operating Systems Solaris how to tar a directory in a sun solaris?
# 1  
Old 05-14-2008
how to tar a directory in a sun solaris?

i have lot of directories which are needed to be transferred to a LINUX workstation. to do this i need to tar the directories. please let me know how to tar the directories in Sun Solaris.
# 2  
Old 05-14-2008
Wear outdoor clothes, grab a big black brush, and

Code:
tar cf /tmp/directories.tar name of directories

where /tmp/directories.tar is the name of the tar file you want to create, and names, of, and directories are, well, names of directories.

Usually you will also want to gzip or bzip2 compress the tar file; some tar commands even have built-in options to do that at the same time as creating the tar archive. Consult your local manual page for the gory details.
# 3  
Old 05-14-2008
thanks for the help.

but it says 'permission denied'. Do you think it is a administrative privilage problem?
# 4  
Old 05-14-2008
also could ypu please tell me how to untar the file in a specified directory?
# 5  
Old 05-14-2008
1) Yes it is an administrative privilage problem.
2) Use man to see how to use tar.
Tornado
# 6  
Old 05-14-2008
Make sure you tar these directories up using relative links
eg
Code:
cd /some/dir/here
tar cf /path/to/tarball.tar subdir1 subdir2 subdir3/onlythispart

rather than
Code:
tar cf /path/to/tarball.tar /some/dir/here/subdir1 /some/dir/here/subdir2 ...

When you untar them again, change into the directory you want them to go to, then run the tar xf to unpack.
By default tar extracts files into the cirrent dir - unless you have used absolute paths when creating the tar, in which case it depends on the implementation of tar as to what it will do.
# 7  
Old 05-15-2008
Quote:
Originally Posted by mmb
also could ypu please tell me how to untar the file in a specified directory?
tar xvf {filename} will tar the file in current directory.
If you want to extract in some other directory, cd to that directory and type
tar xvf {PATH}/{filename}
and the untarred file will be created in pwd
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

2. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

3. Shell Programming and Scripting

tar command dont tar to original directory

HI, if I have a tarfile called pmapdata.tar that contains tar -tvf pmapdata.tar -rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt -rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt -rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
Discussion started by: borderblaster
1 Replies

4. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

5. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

6. UNIX for Dummies Questions & Answers

How to compress a directory on a Sun Solaris 5.7 ?

Hi, Is there any utility to compress an entire directory on a Sun Solaris 5.7 ? Something like "compressdir" on other flavours of Unix ? Thanks (4 Replies)
Discussion started by: sameerdes
4 Replies
Login or Register to Ask a Question