Solved

Untarred files have extra charcters

Posted on 2004-10-08
3
202 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now