Windows does not have the concept of permissions that Linux and Unix have; there is no owner, group and public on Windows files.
If you copy files from Linux to Windows then copy them back there permission masks will be... um, screwy? Sames is true if you simply copy files from Windows: screwy permissions. You can see just how screwy with
Fixing it is fairly easy. Let's say you've copied a directory tree from Windows named, oh, I dunno,
wintree into the
/tmp directory on you Linux box.
Code:
cd /tmp
# first, fix the diretories
find wintree -type d -exec chmod 755 {} \;
# now, fix the files
find wintree -type f -exec chmod 644 {} \;
What that did was set all the directories to the default mode (
755 results in
drwxr-xr-x on a directory) and set all the files to the default mode (
644 results in
-rw-r--r-- on a file).
Now, what about executable shell programs ("scripts")? That depends: if every file in the directory tree should be executable, you could simply do this
Code:
cd /tmp
# fix every directory and make all files executable
find wintree -exec chmod 755 {} \;
which you probably don't really want to do (won't hurt but, you know, it's not "neat and clean").
You can look though the file names and change the mode of individual files that should be executable to 755 or, if the shell programs are named
file.sh you could do this
Code:
cd /tmp
find wintree -type f -name '*.sh' -exec chmod 755 {} \;
(for the life of me I cannot imagine why people using Unix/Linux systems want to have to type a file name extension to execute something but for some reason they like to do that).
Using some combination of the above (plus perhaps a look that the
find manual page) you ought to be able to clean up yet another Windows mess (quick and easy).
Note too that you may --
may -- need to use
sudo in front of the
find above if you're not the owner of the copied tree.
Hope this helps some.