"~" comes in filename after file copy


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting "~" comes in filename after file copy
# 1  
Old 02-18-2011
"~" comes in filename after file copy

I have a windows n/w share mapped to a unix path.

I am trying to copy the file from one unix location to this location using "cp" command.

After I copy the copy and check the filename logging through unix, I can see it as expected. But, when I check the file from Windows at the n/w share, the filename is corrupted with some strange alphabets followed by "~".e.g.: FRPOU00~.txt or RCRTU45~.txt. The data in the file is all consistent, just the filename is the issue...

It should be something like file1.txt or file2.txt. I can see the correct names for those files when connected through unix.

One thing to note here is the file size is about 1GB.

Any help appreciated....
# 2  
Old 02-18-2011
I think those are short 8.3 DOS names and the Unix names somehow do not get translated into the longer Windows names.....
What software and methods are you using on either platform to facilitate the sharing?
# 3  
Old 02-18-2011
Sorry..but can you be more specific about what you mean software/methods being used?

I am just using a "cp src_dir/file.txt tgt_dir/file.txt" command....

Point to be noted here is, I have 4 files out of which 2 files are small files(arnd 400MB) which are copied with no issues.. Only the big 2 files(arnd 1GB) are having the issue...

Also, the smaller files have longer filenames compared to big files and still those are copied successfully...
# 4  
Old 02-18-2011
Lets get some background information here:
  • What kind of UNIX, and what version?
  • What version of Windows?
  • Are the Unix installation and the Windows installation on the same machine? If not, how are files shared between them (FTP, WebDAV, SFTP, SMB/CIFS, NFS, ...)?
# 5  
Old 02-18-2011
Have not seen this one in a while

I seem to recall some kind of compatibility setting. Windows 3.1 used filenames 12345678.123 format. Thus, a long filename such as 1234567890.123 would become 1234567~.123
However, your second comment about "size" of the file also has me intrigued. Coincidence? Can you tell us
original-filename original-filesize final-filename
So we can rule some things in/out of the mix.
# 6  
Old 02-18-2011
original-filename : Transaction_File_1.txt
original-filesize: 961MB
final-filename :FRPOU00~.TXT

Point to be noted here is the other file which is smaller in size(419MB) has a longer filename(Transction_summary_file1.txt) and is still copied correctly.

Also, for the file having issue, I can see the correct final filename when I login through Unix but shows this distorted name when I go through windows.
# 7  
Old 02-18-2011
Can you provide system info?

Quote:
pludi --> Lets get some background information here:

* What kind of UNIX, and what version?
* What version of Windows?
* Are the Unix installation and the Windows installation on the same machine? If not, how are files shared between them (FTP, WebDAV, SFTP, SMB/CIFS, NFS, ...)?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Copy particular file using "ls -ltr"

Hi all, I am new in shell scripting and trying to write a script which does the following: #!/bin/bash $PATH =/a/b/c ls -ltr $PATH $VARIABLE=??? $ls -ltr $PATH -rw-r--r-- 1 18401 1399 127474 Apr 13 07:21 file_abc_1.txt -rw-r--r-- 1 18401 1399 127474 July 13 07:21 file_abc_2.txt... (2 Replies)
Discussion started by: emily
2 Replies

4. UNIX for Dummies Questions & Answers

"tail -n 1 filename" error while "head -n 1 filename" is ok?

Hi all, I was wondering why tail -n 2 filename produce an error when I manage to do similar command on head -n 2 filename SunOS{type8code0}: tail -n 2 filename usage: tail ] tail ] (2 Replies)
Discussion started by: type8code0
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. UNIX for Dummies Questions & Answers

the meaning of "!:*" in "alias foo 'command\!:*' filename"

Hi: How can I remove my own post? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

7. Shell Programming and Scripting

cannot copy file using scp when filename has ":"

hi all , does any one know how can we copy a file using scp which have a file name inlcuding "+:" example : ls -lrt *.csv | tail -3 -rw-r----- 1 opern oper 8479 Feb 15 15:39 LKILA.csv -rw-r----- 1 opern oper 8479 Feb 18 12:06 L+KILA.csv -rw-r----- 1... (4 Replies)
Discussion started by: kiranreddy1215
4 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. AIX

CP to copy file is "stuck"

For some reason, when I attempt to copy a file, using cp, from one location to another the cmd is stuck (or taking an unusually long time). Usually copying a 1 GB file will take 3-4 mins, so far it's at 11 mins and yesterday was stuck for several hours. Is there a way I can see WHY or WHAT is... (5 Replies)
Discussion started by: mcubitt
5 Replies
Login or Register to Ask a Question