tar and relative paths


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting tar and relative paths
# 1  
Old 03-10-2011
tar and relative paths

HOw can I create a tar file with relative paths
Code:
find . -depth -print | xargs tar -cvf /tmp/file.tar

?

Thanks to all who answer

Last edited by Franklin52; 03-10-2011 at 05:40 AM.. Reason: Please use code tags
# 2  
Old 03-10-2011
just use:
Code:
tar cvf /tmp/file.tar .

This User Gave Thanks to Chubler_XL For This Post:
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. Shell Programming and Scripting

Remove leading dot and slash on relative paths with find

When I specify a directory by name the leading ./ is not shown: $ find somedir/ somedir/a.bin somedir/target/out.binBut when I specify current dir it adds the ./ to the beginning of each result: $ find . | grep somedir ./somedir/a.bin ./somedir/target/out.binIs there any particular reason why... (2 Replies)
Discussion started by: Tribe
2 Replies

3. Solaris

exclude absolute paths when extracting Tar file?

Hi, How do I extract data from TAR excluding absolute paths for Tar? (Solaris) Thanks (3 Replies)
Discussion started by: zam
3 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. UNIX for Dummies Questions & Answers

tar symlinks: relative vs absolute

I create the tar file from / like so: tar cEhf name.tar usr/us And this creates the tar with the links intact. The problem is that this tar is going to be used for testing, so we want the links to point to the files in the tar. But when I extract the tar into /tmp, I get /tmp/usr/us/... as I... (2 Replies)
Discussion started by: TreeMan
2 Replies

6. Solaris

Extracting file from tar at relative location!!

Hi Gurus, I have a .tar file which required untar to the new location. I list the content with –tvf its listing the files which are inside the tar, when I am extracting he file from tar its working fine, however once I am trying to extract the file at the new location I am unable to do so. I... (11 Replies)
Discussion started by: kumarmani
11 Replies

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

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

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

10. UNIX for Dummies Questions & Answers

get cygpath to leave relative paths as relative?

If I execute mypath=`cygpath -w ../` echo $mypath I get d:\unix\nextVersion\script OK, d:\unix\nextVersion\script is the correct windows version of the path, but it is in absolute form. I would prefer it if cygpath left it in relative form, i.e. echo $mypath should output ..\ ... (0 Replies)
Discussion started by: fabulous2
0 Replies
Login or Register to Ask a Question