exclude absolute paths when extracting Tar file?


 
Thread Tools Search this Thread
Operating Systems Solaris exclude absolute paths when extracting Tar file?
# 1  
Old 10-19-2011
exclude absolute paths when extracting Tar file?

Hi,
How do I extract data from TAR excluding absolute paths for Tar? (Solaris)

Thanks
# 2  
Old 10-20-2011
You can use pax which allows on the fly path substitution with its -s option.
# 3  
Old 10-20-2011
Solaris 10 also comes with GNU tar as /usr/sfw/bin/gtar which strips leading slashes by default.
# 4  
Old 10-24-2011
Thanks a lot!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Show only the filenames under a directory without relative and absolute paths.

I am able to list all the filenames under a directory & its sub-directories except blent.tar on Linux find "/tmp/" -type f | grep -v blent.tar | rev | cut -d '/' -f1 | rev Desired Output: THIRDPARTYLICENSEREADME.txt javaws libjavaplugin_oji.so libjavaplugin_oji.so... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. UNIX for Dummies Questions & Answers

Exclude file with tar

hi, i am trying to use a exclude file to exclude some file directories while making a tar archive. This is my command: tar -pcvf orahome10gR2.tar.gz db_1 -X /home/oracle/excludeFile.txt /home/oracle/ when i execute it, it seem to be tar-ing. But once is done, i cd to /home/oracle and could... (2 Replies)
Discussion started by: redologger
2 Replies

3. Shell Programming and Scripting

how to remove absolute paths from zip archive

Hi, I need to write an bash script which works like it can copy files from remote machine through ssh to the server where script is running in zip format with the structure i want. I don't want to get absolute path in zip archive. Please let me know how it can be possible. ssh... (4 Replies)
Discussion started by: mirfan
4 Replies

4. UNIX for Dummies Questions & Answers

Absolute and Relative Paths?

Can someone cofirm that I have got the paths correct here? :confused: $PATH_TO_TMP_DIR='/tmp'; #$PATH_TO_TMP_DIR='home/tmp'; $PATH_TO_YOUR_IMG_DIR = '/temp_images'; #$PATH_TO_YOUR_IMG_DIR = 'home/public_html/Midwich/temp_images'; Thanks (1 Reply)
Discussion started by: stubie
1 Replies

5. Shell Programming and Scripting

tar after replacing paths from a file

There is a file paths.txt with paths containing data for example E:/<BUILD_NAME>/data/common E:/<BUILD_NAME>/log/common E:/<BUILD_NAME>/temp/common E:/<BUILD_NAME>/code/common While reading this file I want to replace the <BUILD_NAME> from a variable $BUILD in the following command: tar... (1 Reply)
Discussion started by: muaz
1 Replies

6. Shell Programming and Scripting

tar the paths from a input file

Hi, I have a file paths.txt with all the file paths. I want to tar everything in those paths to a file. for example paths.txt contains /data/extention /logs/extension /code/extenstion Now I want to tar using command tar cvf extention.tar path1 path2 where path1 -> /data/extention... (2 Replies)
Discussion started by: muaz
2 Replies

7. Filesystems, Disks and Memory

Extracting certain /paths/* using tar

forgive my ignorance. I did a search of this sub-forum for "tar -xp" and variations on the same w\out success, so here goes... Scenario: filename.tar file. Desired Task: I want to be able to extract only files from the user's public_html folder (and all those under it as an option) from... (4 Replies)
Discussion started by: Habitual
4 Replies

8. UNIX for Dummies Questions & Answers

TAR : option to exclude absolute path

Dear All , :D I have a question ... I need to exclude the absolute path in the TAR process. For example : system("tar cvf /root/BACKUPS_$fecha.tar /root/BKP/"); system("gzip /root/BACKUPS_$fecha.tar"); I need to exclude de path " /root/BKP/ " in the file.tar.gz What is the parameter to... (1 Reply)
Discussion started by: telco
1 Replies

9. Shell Programming and Scripting

How to exclude file in tar backup?

I am taking a backup of area with the following command:- tar -cf -./* |/usr/contrin/bin/gzip >xxx.tar.gz. The area contains following files :- xxxx yyyy zzzzz asdaD DASdD WQWEE I want to backup all the files except yyyy from the following area. I checked manual page of tar but I... (2 Replies)
Discussion started by: kamlesh_p
2 Replies

10. Shell Programming and Scripting

expanding dotted paths to absolute ones in bash or sh

I have a little script to help me manage a gallery of image files. It makes symbolic links to every file in and below the current directory, placing them in a target directory which is passed to the script as a parameter. Unfortunately, the script pukes when I pass a parameter that contains... (4 Replies)
Discussion started by: TanRanger
4 Replies
Login or Register to Ask a Question