Solved

Untarred files have extra charcters

Posted on 2004-10-08
3
209 Views
Last Modified: 2013-12-16
Hello

I am tarring a web site html directory and moving it to another server.

The site has several files that take on the form My File 6.jpg, My File 8.jpg etc
When I tar these and then untar them they become My\ File\ 6.jpg and My\ File\ 8.jpg

I realize that this is probably due to the spaces in the filename.

Is there any way to preserve the filename exactly with the spaces when I create the tar file.

Thanks
Les
0
Comment
Question by:lesfazekas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Luxana
ID: 12258819
>Is there any way to preserve the filename exactly with the spaces when I create the tar file.

there is way use escape character "\" which tar did for you.

is good habbit to create files with no space or My_File6.jpg



0
 
LVL 10

Assisted Solution

by:Luxana
Luxana earned 125 total points
ID: 12258877
To create files with space you for example My_File6.jpg:

touch My\ File6.jpg
or
touch "My File6.jpg"

So if you si files like My\ File\ 6.jpg and My\ File\ 8.jpg this files are with space just shell escape " " space with \ so they are still  My File 6.jpg and so on..
0
 
LVL 6

Accepted Solution

by:
blkline earned 125 total points
ID: 12366851
There shouldn't be a problem here.

The tar utility is showing the back-slashes in its verbose output (say if you do this: tar -xvzf  myfilename.tgz) but the file itself is stored without the back slashes.  So the effect is harmless.

0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Fine Tune your automatic Updates for Ubuntu / Debian
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question