transfering directories from windows - Help

This is a discussion on transfering directories from windows - Help ; I need to transfer a multi level directory from a fat32 file system to a linux native (ext3) file system. I have a dual boot windows98 mandrake9 system and I'm migrating to using more of linux as I get more ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: transfering directories from windows

  1. transfering directories from windows

    I need to transfer a multi level directory from a fat32 file system to a
    linux native (ext3) file system.

    I have a dual boot windows98 mandrake9 system and I'm migrating to using
    more of linux as I get more familiar with it. I have recently moved all my
    word processing and spredsheet files from my windows partition to my linux
    home directory. As expected everything comes up as executable. I could go
    through all the directories and reset the file permisions manually but that
    would take a long time. I tried to recursivly unset the execute flag with:
    chmod -R a-x *
    but this makes the directories unaccessable (and fails to recurse because of
    that). Is there an easier way to do this?



  2. Re: transfering directories from windows

    Dan Vale wrote:
    > I need to transfer a multi level directory from a fat32 file system to a
    > linux native (ext3) file system.
    >
    > I have a dual boot windows98 mandrake9 system and I'm migrating to using
    > more of linux as I get more familiar with it. I have recently moved all my
    > word processing and spredsheet files from my windows partition to my linux
    > home directory. As expected everything comes up as executable. I could go
    > through all the directories and reset the file permisions manually but that
    > would take a long time. I tried to recursivly unset the execute flag with:
    > chmod -R a-x *
    > but this makes the directories unaccessable (and fails to recurse because of
    > that). Is there an easier way to do this?


    From the same directory you are trying the chmod command,
    you could do something like this:

    find . -type f|sed s/./"chmod 644 ."/>fixmodes.sh

    I think there is a way in bash to execute on the fly, but
    can't remember it now.

    Explanation:

    find . -type f
    Recursively "find"s all files that are actualy files, not
    directories, pipes, etc...

    |sed s/./"chmod 644 ."/
    Output of find is piped into sed. sed is a stream editor.
    Does a substitution of the first occurance of '.' with
    'chmod 644 .'. This makes a valid chmod command line.

    >fixmodes.sh

    Output of sed is redirected to the file 'fixmodes.sh'.

    Then just make fixmodes.sh executable and run it with:
    chmod +x fixmodes.sh
    ../fixmodes.sh


    I'm sure there is a better way, but this will work.

    --
    Kevin D. Snodgrass
    kdsnodgrass (at) yahoo [dot] com


  3. Re: transfering directories from windows

    Kevin D. Snodgrass wrote:
    > Dan Vale wrote:


    > From the same directory you are trying the chmod command,
    > you could do something like this:
    >
    > find . -type f|sed s/./"chmod 644 ."/>fixmodes.sh


    [snip explanation]

    You can also use find's -exec parameter:

    find . -type f -exec chmod 644 {} \;

    Or, if you wanted to preserve the rest of the permissions:

    find . -type f -exec chmod a-x {} \;

    --
    ZZzz |\ _,,,---,,_ Travis S. Casey
    /,`.-'`' -. ;-;;,_ No one agrees with me. Not even me.
    |,4- ) )-,_..;\ ( `'-'
    '---''(_/--' `-'\_)

  4. Re: transfering directories from windows

    Travis Casey wrote:
    > Kevin D. Snodgrass wrote:
    >
    >>Dan Vale wrote:

    >
    >
    >> From the same directory you are trying the chmod command,
    >>you could do something like this:
    >>
    >>find . -type f|sed s/./"chmod 644 ."/>fixmodes.sh

    >
    >
    > [snip explanation]
    >
    > You can also use find's -exec parameter:
    >
    > find . -type f -exec chmod 644 {} \;
    >
    > Or, if you wanted to preserve the rest of the permissions:
    >
    > find . -type f -exec chmod a-x {} \;
    >


    I knew it was easy, but couldn't remember how easy. :-)

    --
    Kevin D. Snodgrass
    kdsnodgrass (at) yahoo [dot] com


  5. Re: transfering directories from windows

    Thanks, that fixed it.

    dan

    "Kevin D. Snodgrass" wrote in message
    news:3FF10C9B.3050905@spamcop.net...
    > Travis Casey wrote:
    > > Kevin D. Snodgrass wrote:
    > >
    > >>Dan Vale wrote:

    > >
    > >
    > >> From the same directory you are trying the chmod command,
    > >>you could do something like this:
    > >>
    > >>find . -type f|sed s/./"chmod 644 ."/>fixmodes.sh

    > >
    > >
    > > [snip explanation]
    > >
    > > You can also use find's -exec parameter:
    > >
    > > find . -type f -exec chmod 644 {} \;
    > >
    > > Or, if you wanted to preserve the rest of the permissions:
    > >
    > > find . -type f -exec chmod a-x {} \;
    > >

    >
    > I knew it was easy, but couldn't remember how easy. :-)
    >
    > --
    > Kevin D. Snodgrass
    > kdsnodgrass (at) yahoo [dot] com
    >




  6. Re: transfering directories from windows

    Dan Vale wrote:
    > I need to transfer a multi level directory from a fat32 file system to a
    > linux native (ext3) file system.
    > As expected everything comes up as executable.


    Use the appropriate mount options for vfat to avoid this.

    man mount

  7. Re: transfering directories from windows

    On Mon, 29 Dec 2003 14:29:16 -0600, Kevin D. Snodgrass wrote:

    > Dan Vale wrote:
    >> I need to transfer a multi level directory from a fat32 file system to a
    >> linux native (ext3) file system.
    >>
    >> I have a dual boot windows98 mandrake9 system and I'm migrating to using
    >> more of linux as I get more familiar with it. I have recently moved all
    >> my word processing and spredsheet files from my windows partition to my
    >> linux home directory. As expected everything comes up as executable. I
    >> could go through all the directories and reset the file permisions
    >> manually but that would take a long time. I tried to recursivly unset
    >> the execute flag with: chmod -R a-x *
    >> but this makes the directories unaccessable (and fails to recurse
    >> because of that). Is there an easier way to do this?

    >
    > From the same directory you are trying the chmod command,
    > you could do something like this:
    >
    > find . -type f|sed s/./"chmod 644 ."/>fixmodes.sh
    >
    > I think there is a way in bash to execute on the fly, but can't remember
    > it now.


    find does it all by itself:

    find . -type f -exec chmod 644 {} \;

    --
    Avoid reality at all costs.
    $email =~ s/oz$/au/o;


+ Reply to Thread