LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-12-2010, 05:14 AM   #1
AnPe
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
untar windows-files


Hi there.
I´m trying to untar files on my linux-server, that was created on a windows-server. The problem is that the file is in a windows subdirectory, and therefor contains a "\" in the filename. How can I untar a file xxxxx\yyyy.zzz from an windows-archive, to a linux xxxxx/yyyy.zzz.

Or isn´t it possible?
 
Old 11-12-2010, 07:27 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Assuming this is actually just about an illegal character in the filename, just escape it, putting an extra \ before it, i.e. xxxxx\yyyy.zzz becomes xxxxx\\yyyy.zzz or enclose the whole file name in single quote marks - 'xxxxx\yyyy.zzz'
 
Old 11-13-2010, 01:08 PM   #3
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 374
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
pax and tar can both deal with this.

pax -r -f foo.tar -s ',\\,/,'

tar xf foo.tar --transform='s,\\,/,'
 
1 members found this post helpful.
Old 11-14-2010, 02:05 PM   #4
AnPe
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by BenCollver2 View Post
pax and tar can both deal with this.

pax -r -f foo.tar -s ',\\,/,'

tar xf foo.tar --transform='s,\\,/,'

Lovely. This solved all my problems. I´ve been looking for this in man-pages and on the net, but not found it. Thanks a lot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to untar all tar-files in a directory? zoomzoom Linux - Newbie 13 05-09-2017 11:52 AM
untar files only when required rsiyer Linux - General 1 07-12-2010 06:38 PM
how to untar *.dpkg.md5 files gauri Debian 3 02-17-2006 02:52 AM
untar multiple files redhax8 Linux - Software 2 10-18-2004 01:13 AM
a way to untar multiple files alphisb0t Linux - Software 1 07-05-2004 12:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration