Skip to main content
1 of 6
user avatar
user avatar

cp command in bash script modifies filename

I have a bash script which copies data across to a USB stick. It works. The data is copied across fine, but the filenames are always changed. They are the same as they were before, but any longer names are cut to only 8 chars long, and have an extension that is only 3 chars long (11 char max total). So an original file called "willGetCutShorter.html" becomes "willGetS.htm" on the drive, whereas "small.txt" stays the same. Copied directory names are cut in the same way, all appearing 8 chars long (they have no extension, of course).

I don't want this to happen. I want the file and directory names to not be modified at all. I don't know why this is happening either.

I my bash script, I copy everything in my computer directory to the drive using an asterisk to represent all the computer directory contents. I'm wondering if this is why? Perhaps cp is only grabbing part of the filename?

Also, while in Linux the files appear all in lowercase, even stuff that was originally part uppercase. In Windows however, all files and folders are uppercase.

Why?? It doesn't make sense. Thanks a lot!

user179130