Solved

Untarred files have extra charcters

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bash file 10 49
PHP error function not working on AWS 10 65
Setup Ubuntu 16.04 to use LDAP for user login and authentication 2 56
Apache LDAP Authentication 20 23
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

792 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